32-bit, 64-bit operating system base data type byte size

Source: Internet
Author: User

The length of the basic data type in the C language:

Under 32 bits:

Char:1 bytes (unchanged)

* (pointer variable): 4 bytes (32-bit machine's addressing space is 4 bytes.) Similarly 64-bit compilers) (change)

Short Int:2 bytes (unchanged )

Int:4 bytes (unchanged )

Unsigned int:4 bytes (unchanged )

Float:4 bytes (unchanged )

Double:8 bytes (unchanged )

Long:4 bytes (varies )

Unsigned long:4 bytes (change *, is actually the address length value of the addressing control)

Long Long:8 bytes (unchanged )


Under 64 bits:

Char 1 bytes (unchanged )

* (pointer variable): 8 bytes

Short Int:2 bytes (unchanged )

Int:4 bytes (unchanged )

Unsigned int:4 bytes (unchanged )

Float:4 bytes (unchanged )

Double:8 bytes (unchanged )

Long:8 bytes (varies )

Unsigned long:8 bytes (change * is actually the address length value of the addressing control)

Long Long:8 bytes (unchanged )

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

In OC:

64-bit system (this machine is not a 32-bit system can not be tested):

NSString 8-bit

Nsinteger 8-bit (signed)

Nsuinteger 8 bits (unsigned, no negative numbers)

Many variables in OC are actually pointers, so many of the 64-bit systems are 8-bit,

By the way, NSNumber,Nsinteger is the underlying type, but NSNumber is a class. If you want to Nsmutablearray or

nsmutabledictionary Store A value, the direct use of Nsinteger is not, to first convert to NSNumber class,


This article refers to the http://blog.csdn.net/totogo2010/article/details/7655908


32-bit, 64-bit operating system base 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.