Skip to content

Instantly share code, notes, and snippets.

@jozsefDevs
Created October 22, 2013 20:21
Show Gist options
  • Save jozsefDevs/7107462 to your computer and use it in GitHub Desktop.
Save jozsefDevs/7107462 to your computer and use it in GitHub Desktop.
Implementing toUpperCase() by Bitwise programming
#include <iostream>
using namespace std;
int main(){
char bitwiseMask = 0xdf, lowCase = 'a';
char upperCase = (char)(lowCase & bitwiseMask);
cout << upperCase << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment