实测代码
1 void CalculateDataTypeSize(void) 2 { 3 printf("sizeof(char} = %u ", sizeof(char)); 4 printf("sizeof(short} = %u ", sizeof(short)); 5 printf("sizeof(int} = %u ", sizeof(int)); 6 printf("sizeof(long} = %u ", sizeof(long)); 7 printf("sizeof(long long} = %u ", sizeof(long long)); 8 printf("sizeof(float} = %u ", sizeof(float)); 9 printf("sizeof(double} = %u ", sizeof(double)); 10 }
输出结果