NT Type word length problem:
①c/c++ specifies that int word length is the same as machine word length;
② operating system word length and machine word length may not be consistent;
③ compiler defines int word length according to the operating system word length;
From the above three points, in some non-operating system embedded computer system, the length of int and processor word consistency;
System, the word length of the operating system does not necessarily coincide with the length of the processor, when the compiler defines the int word length according to the operating system's word length: "
For example, if you are running the DOS16 system on a 64-bit machine, then all of the C + + compilers for DOS16 are 16-bit int; on 64-bit machines
Run the Win32 system, then all the C + + compilers for the for Win32 int are 32-bit "
Common basic types of byte size
32-bit operating system
Char:1 bytes (fixed)
* (i.e. pointer variable): 4 bytes (32-bit machine's addressing space is 4 bytes.) 64-bit compiler) (change *)
Short Int:2 bytes (fixed)
Int:4 bytes (fixed)
Unsigned int:4 bytes (fixed)
Float:4 bytes (fixed)
Double:8 bytes (fixed)
Long:4 bytes
Unsigned long:4 bytes (change *, is actually the address length value of the addressing control)
Long long:8 bytes (fixed)
64-bit operating system
Char:1 bytes (fixed)
* (i.e. pointer variable): 8 bytes
Short Int:2 bytes (fixed)
Int:4 bytes (fixed)
Unsigned int:4 bytes (fixed)
Float:4 bytes (fixed)
Double:8 bytes (fixed)
Long:8 bytes
Unsigned long:8 bytes (change * is actually the address length value of the addressing control)
Long long:8 bytes (fixed)
Except that * and long vary with the operating system Zichang, others are fixed (32-bit vs. 64)
BOOL 1 bytes char 1 byte int 4 bytes float 4 bytes Doubl 8 bytes Long Long 8 bytes
32-bit 64-bit operating system basic data type byte size