Skip to content

Instantly share code, notes, and snippets.

@zg
Last active August 29, 2015 14:02
Show Gist options
  • Save zg/dfe20cb6ea5b920fe558 to your computer and use it in GitHub Desktop.
Save zg/dfe20cb6ea5b920fe558 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(){
unsigned int i = 1;
char *p = (char *)&i;
if(*p == 0)
printf("big endianness");
else
printf("little endianness");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment