#include void printBytes(unsigned char *ptr, int len); int main(void){ int x = 1; // 0x00000001 // LITTLE 01 00 00 00 // BIG 00 00 00 01 unsigned char * ptr; ptr = (unsigned char *) &x; printf("%x %x %x %x\n",*ptr, *(ptr+1),*(ptr+2),*(ptr+3)); return 0; } /** We write it as 0x00000000 00000000 00000000 00000001 But on our machine is it stored like 0x1000 00000000 BIG 0x1001 00000000 0x1002 00000000 0x1003 00000001 OR 0x1000 00000001 LITTLE 0x1001 00000000 0x1002 00000000 0x1003 00000000 */