Skip to content

Instantly share code, notes, and snippets.

@nlinker
Created October 12, 2012 03:46
Show Gist options
  • Save nlinker/3877185 to your computer and use it in GitHub Desktop.
Save nlinker/3877185 to your computer and use it in GitHub Desktop.
test big or litte endian
int bigOrLitteEndian() {
short int word = 0x0001;
char *byte = (char *) &word;
return (byte[0] ? 1 : 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment