OC Data type

Source: Internet
Author: User

OC is an enhanced C feature, so it is basically consistent with C on variables and basic data types.

In OC, variable naming has the following rules:

Consists of letters, numbers, underscores, and $ symbols

Must start with a letter, underscore, $ symbol

Case sensitive

The reserved words of OC cannot be used when defining variables in OC, and the reserved words of OC are as follows:

The following basic data types are available in OC:

int: Declaring an integer variable

Double: Declaring a two-precision variable

float: Declaring floating-point variables

Char: Declaring a character-type variable

ID: Generic pointer type

Enum: declaring enum type

Long: Declares a variable or function of length integer

Short: Declaring a variable or function with a shorter integer

Signed: Declaring a signed type variable

struct: Declaring struct-body variables

Union: Declaring a common body (union) data type

Unsigned: Declaring an unsigned type variable

void: Declares that a function has no return value or no argument

Data type formatting characters:

Data type OC keyword format description boot character

integer int%d.%i

Short int%hd.%hi

Long, type long int%ld.%li

Unsigned short-integer unsigned int%u

No short integral type unsigned shorter%hu

unsigned long integer unsigned%lu

Float type float%f

Double-%f

Long Double%LF

Character Char-%c

Reprinted from: http://blog.csdn.net/mengxiangyue/article/details/11369679

OC Data type

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.