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 }

输出结果

 

posted @ 2020-07-08 00:12  壹点灵异  阅读(369)  评论(0编辑  收藏  举报