基本数据类型 int float double char int a; int b = 0;int c = b; float f;float f2 = 0.1;float f3 = 1.0;double num; char c = ‘A‘;char C = ‘a‘;char cc = c;
NSString:@"hello world"
限定词 long ; long long ;short ;unsigned;signed; long int a; long long int a; short int a;short a; unsigned int a;signed int a;
指针类型 自定义类型 万能类型
算术表达式与运算符 一元运算符: ++ -- ; 二元运算符: + - × / % ;三元运算符: 2<3?YES:NO
逻辑运算符
#import<Foundation/Foundation.h>
int main(int argc,const char * argv[]){
@autoreleasepool{
int a = 1;
a++;
a++;
++a;
int b = 2;
b = b+a;
int c = 6;
int n = 9;
int m = 2;
int s = a+b*c-5%3;
NSLog(@"%d,n%m");
NSLog(@"变量a+变量b的值:%d",++a);
NSLog(@"变量a+变量b的值:%d",a);
NSLog(@"%d",s);
}
return 0;
}