Skip to content

Commit

Permalink
Added reference to StackOverflow inspiration for extra-credit #4
Browse files Browse the repository at this point in the history
  • Loading branch information
noahlz committed May 22, 2012
1 parent d04f892 commit afb8c21
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ex9.c
Expand Up @@ -129,6 +129,8 @@ int main(int argc, char *argv[])
c[3] = '\0';
printf("chars as hex bytes: %X %X %X %X\n", c[0], c[1], c[2], c[3]);
// How to get these into an integer? Bitwise manipulation.
// Inspired by (not copied from) this StackOverflow question:
// http://stackoverflow.com/q/8173037/7507
unsigned int num;
num = c[0] << 24;
num = (c[1] << 16) | num;
Expand Down

0 comments on commit afb8c21

Please sign in to comment.