Created
October 22, 2013 20:21
-
-
Save jozsefDevs/7107462 to your computer and use it in GitHub Desktop.
Implementing toUpperCase() by Bitwise programming
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
#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