/* Check for Endian */ #include #include int main(int argc, char **argv){ unsigned char EndianTest[2] = { 1, 0 }; short x; x = *(short *) EndianTest; if(x == 1) printf("This machine is of Little Endian\n"); else printf("This machine is of Big Endian\n"); } /* End of check for Endian */