32-bit 64-bit operating system basic data type byte size

Source: Internet
Author: User

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

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.