/* * A simple program that demonstrates the endianness of a machine. * */ #include <stdio.h> int main(int argc, char* argv[]) { int v = 0x12345678; unsigned char *c = &v; printf("First byte %x\t Second byte %x\t Third byte %x\t Fourth byte %x\n", c[0], c[1], c[2], c[3]); return 0; }