Created
September 14, 2017 21:12
-
-
Save Kylmakalle/90b6b71b5a3ff6a605fba5a5d603b452 to your computer and use it in GitHub Desktop.
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
void binary_form(int TYPE) { | |
int z; | |
for (char j = sizeof(int) * 8 - 1; j >= 0; j--) { | |
z = ((int)1) << j; | |
if ((TYPE & z) != 0) | |
std::cout << 1; | |
else | |
std::cout << 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment