Created
April 8, 2019 15:30
-
-
Save gerrard00/3576c5ba69c23903bc31fc1fce0dc4b0 to your computer and use it in GitHub Desktop.
Toggle the case of any ascii char by xoring 32 (space character)
This file contains hidden or 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
#include <stdio.h> | |
char toggle_case(char c) { | |
return c ^ 32; | |
} | |
int main(int argc, char ** argv) { | |
printf("Hello%c\n", toggle_case(*(argv[1]))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment