简答判断题
👁️ 浏览量:

试题题干

设struct student
{
char name [20];
char sex;
}stu;
语句printf(″%d\n″,sizeof(stu));的输出结果是 

参考答案

试题解析

char name [20];定义的一维数组有20个元素,即占用的内存字节数为20;char sex;占用的内存字节数为1,即在执行语句printf(″%d\n″,sizeof(stu));时输出结果是 20+1=21。