32-bit: the size of the basic data type in a 64-bit operating system in bytes.

Source: Internet
Author: User

32-bit: the size of the basic data type in a 64-bit operating system in bytes.

The length of the basic data type in C language:

32-bit:

Char: 1 byte (unchanged)

* (Pointer variable): 4 bytes (the addressing space of 32-bit machines is 4 bytes. Similarly, 64-bit compiler) (changed)

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 (changed)

Unsigned long: 4 bytes (change * is actually the address Length Value of the addressing control)

Long: 8 bytes (unchanged)


64-bit:

Char 1 byte (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 (changed)

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

Long: 8 bytes (unchanged)
 

Except for the change of * and long with the length of the operating system, the others remain unchanged (compared with 32-bit and 64-bit)

Bool 1 byte char 1 byte int 4 byte float 4 byte doubl 8 byte long 8 byte

Oc:

64-bit system (the local machine is not a 32-bit system and cannot be tested ):

Nsstring 8-bit

Nsinteger 8-bit (Signed)

NSUInteger 8-bit (unsigned, no negative number)

Many variables in oc are actually pointers, so many 64-bit systems are 8-bit,

By the way, nsnumber is a basic type, but NSNumber is a class. If you want

NSMutableDictionary stores a value, which cannot be directly used by NSInteger. You must first convert it to the nsnumber class,


This article references http://blog.csdn.net/totogo2010/article/details/7655908


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.