Little Endian Vs Big Endian
How the term Endian came into existence?
It came from the debate of habit of eating eggs from the book “Gulliver’s Travels”. Some people liked to eat from the little end first(little endian) and some people liked to eat from the Big End(Big Endian). This difference in habit led to many conflicts.
Why so many users are unaware of endianess?
You don’t need to take care of endianness when the systems you are using are of the same nature(all big endian or all little endian). You need to take care of endianess when you are dealing with systems having different endianness. Most of the systems for personal use are little endian in nature so you don’t feel the need to know endianness.
What difference does it make?
When data is transferred from Little Endian to Big Endian or the other way, representation of the memory changes.
If a number(unsigned short) is represented as
in Little Endian, it will be read as
in Big Endian. You can observe the byte swapping(0x12 and 0x34).
This has nothing to do with the memory. For the same memory content, interpretation is different for Little Endian Machine and Big Endian Machine.
You don’t have to worry about Endianness in case you are dealing with systems of same Endianness. But, if you are communicating over systems of different endianness, you have to take care of byte swapping.