Byte order refers to the order in memory of data that occupies more than one byte of memory, usually with a small, big-endian byte order.
small-endian byte-order refers to low-byte data stored at low memory address, high-byte data stored at high memory address;
The big endian byte order is that the high-byte data is stored at the low address, and the low-byte data is stored at the high address.
High, Low byte
The general PC is low-byte order , if the usual writing habits, from left to right is high to status order, then for example, 0x12345678, in memory situation is
High Address
12
34
56
78
Low Address
High Address: memory address can correspond to hexadecimal value, the value is high address, otherwise low address;
3. Summary
integer type internal: Low address store lows, high address storage highs.
Local variables: Define the high address first, and then define the low address.
class, struct, array: the low address defined first, and the high address defined later .
The actual space occupied by the array is larger than the element and feels like a "pointer type" space for the array name itself, which is 4 bytes.
Intel processor Small-end mode
TCP/IP big endian mode
Learning notes for C/b + +---High address, low address, large segment byte sequence, small segment byte order