C code to check your system's endianness
/* if you don't know what is "Endianness", here is a wikipedia article about the topic: Endianness */
#include <stdio.h> int main(){ Â Â Â unsigned short s = 0x0001; Â Â Â unsigned char c; Â Â Â /*point to 's' using a char pointer, then dereference it, this will access the first byte of 's' and copy it to 'c'.*/ Â Â Â c = *(unsigned char *) &s;
  if(c == 0x01){       printf("this is a little endian system.\n");    }else{       printf("this is a big endian system.\n");    }    return 0; }











