So I\'m writing a program to test the endianess of a machine and print it. I understand the difference between little and big endian, however, from what I\'ve found online,
Here's what the memory will look like, assuming a 32b integer:
Little-endian
0x01000000 = 00000001000...00
Big-endian
0x00000001 = 0......01
Dereferencing a char * gives you one byte. Your test fetches the first byte at that memory location by interpreting the address as a char * and then dereferencing it.