STM32F429 实测基本数据类型占用空间
实测代码
1 void CalculateDataTypeSize(void) 2 { 3 printf("sizeof(char} = %u\r\n", sizeof(char)); 4 printf("sizeof(short} = %u\r\n", sizeof(short)); 5 printf("sizeof(int} = %u\r\n", sizeof(int)); 6 printf("sizeof(long} = %u\r\n", sizeof(long)); 7 printf("sizeof(long long} = %u\r\n", sizeof(long long)); 8 printf("sizeof(float} = %u\r\n", sizeof(float)); 9 printf("sizeof(double} = %u\r\n", sizeof(double)); 10 }
输出结果
再牛逼的梦想也架不住傻逼似的坚持