Learning notes for C/b + +---High address, low address, large segment byte sequence, small segment byte order

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.