Skip to main content

Little and Big Endian

Endianness

Little and big endian are two ways of storing multibyte data-types into memory. For single byte data-types like a char, it doesn't matter what the endian because it is only one byte. Duh.

Let's assume that an integer is 4 bytes in the 32 bit system that we are working with in C.

Let's have the hexadecimal value 0x01234567 this is 32 bit remember every 2 hexadecimal digit is one byte, there is 4 pair of the hexadecimal digits hence 32 bits.

Now we will be storing it into memory and these are the two layouts:

image.png