IOS--DAY01---data types

Source: Internet
Author: User

Data types---Basic data types, constructed types, pointer types

Basic data Types-integer, float, character, enum type

Constructed type---array type, struct type, common type

Pointer type

-------------------------------

Boolean type:

The lower level of OC is actually using signed char to represent BOOL, while the bottom of the Yes,no two value is actually 1 and 0;

A non-zero integer assigned to a variable of type bool may not be yes! If 256 is converted to binary 100000000 at the bottom, this will get no

--------------------------------

Expression type auto-promotion

When an arithmetic expression contains values of more than one base type, the data type of the entire arithmetic expression will automatically ascend.

The data types are from low to high levels, respectively:

Short---int---long---long long---float----double---long double

Short s=5;

NSLog (@ "%ld", sizeof (s-2));

------------------------------------

IOS--DAY01---data types

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.