id 类型格式化说明符 %p
NSString %@
NSString *s = @"1234";
NSLog(@"String:%@",s);
int %d
int i = 1234;
NSLog(@"int:%d",i);
long %ld
long l = 1000000000000L;
NSLog(@"%ld",l);
long long %lld
long long ll =1000000000000L;
NSLog(@"%lld",ll);
float %f
float f = 123.23f;
NSLog(@"float:%f",f);
double %f %e %g
double d = 1.23;
NSLog(@"double:%f",d);
char %c
char c = 'z';
NSLog(@"Char:%c",c);
NSLog(@"ASCII:%d",c);
//占用的字节数量
NSLog(@"sizeOf:%ld",sizeof(c));
bool %d
bool b = true;
NSLog(@"boolean:%d",b);
评论区