Using Python can quickly get information about the system, such as the platform, byte order, and Python's maximum recursion limit, such as:
Import sys# get byte orderprint sys.byteorder# get platform print sys.platform# Nothing to say ^_^ print Sys.getrecursionli MIT ()
The following C code validation can be used with respect to the byte order:
1#include <stdio.h>2 3typedef unsignedChar*Char_format;4 5 voidShow_byte (Char_format type,intlength) {6 7 inti;8 for(i =0; i < length; i++) {9fprintf (stdout,"%2.x", Type[i]);Ten } Onefprintf (stdout,"\ n"); A } - - intMainintargcChar Const*argv[]) { the - intnum =0x12345678; - -fprintf (stdout,"%x:", num); +Show_byte (Char_format) &num,sizeof(num)); - + return 0; A}
The small end sequence is the lower weight in front, the big endian is the high weight in front.
For example, 0x12345678 is stored in small-endian order at 78 56 34 21, while the big endian is stored in 12 34 56 78.
Python gets host byte order