-
-
Save parzibyte/016e7a8901e50c4d8d4e659d5ea17079 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Convert C string to lowercase | |
@author parzibyte | |
*/ | |
#include <stdio.h> | |
#include <ctype.h> | |
int main(int argc, char const *argv[]) | |
{ | |
char my_string[] = "Hello world! this is a simple string. parzibyte.me"; | |
printf("Original string: %s\n", my_string); | |
// Convert each char | |
// using tolower | |
for (int index = 0; my_string[index] != '\0'; ++index){ | |
my_string[index] = tolower(my_string[index]); | |
} | |
printf("After convert: %s\n", my_string); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment