This how the bytes are ordered in memory.
Very important especially when dealing with sockets.
Crux of it - Check the starting address.
- BIG - Most Significant BYTE (MSB)
- LITTLE - Less Significant BYTE (LSB)
// Consider a 4 byte integer.
int32_t a = 0xABCDEFGH;
// Big Endian
start address -> AB CD EF GH
// Little Endian
start address -> GH EF CD AB
Considerations:
- Machines mostly little endian. Helps expansion typecasting.
- Network Byte Order (Socket Comms) is big endian.
- Typecasting scenarios where the size of datatype changes.