Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created February 11, 2013 22:45
Show Gist options
  • Select an option

  • Save KristianLyng/4758328 to your computer and use it in GitHub Desktop.

Select an option

Save KristianLyng/4758328 to your computer and use it in GitHub Desktop.
$ cat foo.c; gcc foo.c; ./a.out
#include <stdio.h>
main() {
int i = 16777343;
char *a = (unsigned char *)&i;
printf("IP: %d er %hhu.%hhu.%hhu.%hhu.\n",i, a[0], a[1], a[2], a[3]);
}
IP: 16777343 er 127.0.0.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment