OBJ-C basic syntax, data type, operators, and control statements

Source: Internet
Author: User

OBJ-c Property: alternative to setter and getter Methods

The source file extension introduces the introduction of library files # import Basic data type, object type, ID type

Basic data types: int, float, double, and char (the number of bytes is related to the device platform. obj-C is not a cross-platform language) Int % I: 10 hexadecimal % O: 8 hexadecimal % # X: 16 hexadecimal Float: single precision % F % E (Scientific count) % G Double: double % F % E (Scientific count) % g char: % C qualified words long, long, long double, unsigned, signed Object Type: pointer type (static data type) ID type: can replace any data type, but Id type is only applied to object type (dynamic data type) _ Bool (alias bool) type: the value ranges from 0 to 1, 1: True and yes, and 0: false and No. Enumeration type: a group of related Constants Enum direction {up, down, left, right} Up, down, left, and right represent the conversion relationships of the 0, 1, and 2 data types, respectively: Constant const int I = 0; (must have an initial value) bit operator instance

The control statements are basically the same as those in C and Java.

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.