天天看點

IOS中的輸出格式符彙總

#import <Foundation/Foundation.h>

int int main(int argc, char const *argv[])

{

int year =2013;

NSLog(@"今年是 %d 年\n",year);

NSLog(@"argc=%d\n",argc);

int i=100;

float f=1.1;

double d=2.2;

short int si=200;

long long int ll=12342342434234234213421L;

char c='c';

bool b=true;

BOOL bl=true;

NSLog(@"i=%d size=%u byte",i,sizeof(i));

NSLog(@"f=%f size=%u byte",f,sizeof(f));

NSLog(@"d=%e size=%u byte",d,sizeof(d));

NSLog(@"si=%d size=%u byte",si,sizeof(si));

NSLog(@"ll=%lli size=%u byte",ll,sizeof(ll));

NSLog(@"c=%c size=%u byte",c,sizeof(c));

NSLog(@"b=%d size=%u byte",b,sizeof(b));

NSLog(@"i=%d size=%u byte",i,sizeof(i));

return 0;

}