无
不同整型数据类型在内存中占多大(字节),具体格式详见输出样例,输出样例中的?为不同整型数据类型在内存中占的字节数。输出样例如下:
The size of short is ? bytes.
The size of int is ? bytes.
The size of long is ? bytes.
The size of long long is ? bytes.
#include<stdio.h> int main(void){ printf("The size of short is %d bytes.\n", sizeof(short)); printf("The size of int is %d bytes.\n", sizeof(int)); printf("The size of long is %d bytes.\n", sizeof(long)); printf("The size of long long is %d bytes.\n", sizeof(long long)); return 0; }考察sizeof的使用,基础知识,输出的内容最好是复制题目中的,以免打错,然后把?改成%d,printf里面再跟sizeof表达式参数即可
int main() { printf("The size of short is %d bytes.\n", sizeof(short)); printf("The size of int is %d bytes.\n", sizeof(int)); printf("The size of long is %d bytes.\n", sizeof(long)); printf("The size of long long is %d bytes.\n", sizeof(long long)); return 0; }