Skip to content

Instantly share code, notes, and snippets.

@warfares
warfares / toLower.c
Created October 9, 2013 12:17
copy string to lower case.
#include <stdio.h>
#include <string.h>
int main() {
char *s1 = "I Used to BE An UPPER CASE StrinG\n";
/* alloc memory and copy the string (to preserve the original reference */
char *s2 = strdup(s1);
unsigned i;
for (i = 0; i < strlen(s2); i++)