Skip to content

Instantly share code, notes, and snippets.

@jacyzon
Created May 1, 2012 14:32
Show Gist options
  • Save jacyzon/2568338 to your computer and use it in GitHub Desktop.
Save jacyzon/2568338 to your computer and use it in GitHub Desktop.
Convert string to uppercase
#include <stdio.h>
#include <stdlib.h>
int main() {
char input[100];
char *chkChar = input;
fgets(input, sizeof(input), stdin);
for(; *chkChar!='\0'; chkChar++)
if ('a' < *chkChar && *chkChar < 'z') *chkChar -= 'a'-'A';
printf("%s\n", input);
return system("pause");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment