Created
January 26, 2017 07:51
-
-
Save rhulha/cff014effe5abed227ac878dcf2eb22b to your computer and use it in GitHub Desktop.
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
| void printBitsI(unsigned int num) | |
| { | |
| for (int bit = 0; bit<(sizeof(unsigned int) * 8); bit++) { | |
| printf("%i ", num & 0x01); | |
| num = num >> 1; | |
| } | |
| } | |
| void printBitsC(unsigned char num) | |
| { | |
| for (int bit = 0; bit<(sizeof(unsigned char) * 8); bit++) { | |
| printf("%i ", num & 0x01); | |
| num = num >> 1; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment