-
-
Save parzibyte/9c7366a1a3ac2f8c1b9e546ce72e9183 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 uppercase | |
@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 toupper | |
for (int index = 0; my_string[index] != '\0'; ++index){ | |
my_string[index] = toupper(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