Created
July 18, 2014 16:25
-
-
Save daltonclaybrook/163b642111ac27aaddd0 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
#include <stdio.h> | |
int main(int argc, const char * argv[]) | |
{ | |
char input[] = { 0xFF, 0x81, 0xBD, 0xA5, 0xA5, 0xBD, 0x81, 0xFF }; | |
for (int i=0; i<8; i++) | |
{ | |
char hex = input[i]; | |
for (int j=0; j<8; j++) | |
{ | |
int shift = 7-j; | |
if (((hex >> shift) & 1) == 1) | |
{ | |
printf("x"); | |
} | |
else | |
{ | |
printf(" "); | |
} | |
} | |
printf("\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment