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