NetEase Cloud Classroom _ Aishu: 0 Basic one-stop C language | C Programming Explaining _ Chapter 5 Integer _ Class 40 Storage of Integer data (byte-order)

Source: Internet
Author: User

int data = 0x12345678;

#include <stdio.h> #include <stdlib.h>int main () {int data = 0x12345678;char *p = (char *) &data;printf ("%p %hhx\n ", & (P[0]), p[0]);p rintf ("%p%hhx\n ", & (P[1]), p[1]);p rintf ("%p%hhx\n ", & (P[2]), p[2]);p rintf ("%p% Hhx\n ", & (P[3]), p[3]); System (" pause "); return 0;}

Output

00000034b476fbe4 78
00000034b476fbe5 56
00000034b476fbe6 34
00000034b476fbe7 12
Please press any key to continue ...

It is learned that 78 is a low byte and 12 is a high byte.

The byte order is divided into: small-endian byte-order, big end byte-order.

12 is a high byte

78 is low byte

564654

NetEase Cloud Classroom _ Aishu: 0 Basic one-stop C language | C Programming Explaining _ Chapter 5 Integer _ Class 40 Storage of Integer data (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.