Skip to content

Instantly share code, notes, and snippets.

@benwaffle
Last active August 29, 2015 14:00
Show Gist options
  • Save benwaffle/d2ded21a7b355d6c6845 to your computer and use it in GitHub Desktop.
Save benwaffle/d2ded21a7b355d6c6845 to your computer and use it in GitHub Desktop.
xor flip case
#include <ctype.h>
char flip(char in) {
if (isalpha(in))
if (isupper(in))
return tolower(in);
else
return toupper(in);
return in;
}
or
char flip(char in){
return isalpha(in) ? in ^ ' ' : in;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment