标签:
sizeof()
int :4个字节
short int: 2个字节
long long int: 8个字节
float:4个字节
double:8个字节
char: 1个字节
char *: 8个字节
NSString: 8个字节
例子:
struct baseValueStruct{
int age;
char sex;
float point;
long long int momey;
};
struct baseValueStruct baseStruct = {14, ‘2‘, 3.2,2189};
NSLog(@"size:%lu",sizeof(baseStruct)); //输出地是24: 4 + 1 (+3) + 4 (+ 4) + 8
标签:
原文地址:http://my.oschina.net/caijunrong/blog/510664