编写input()函数输入5个学生的数据记录。(用结构体设计,学生记录中包括学号、姓名、四门课程成绩).【1】、【2】分别填写的是( )。 #include#define N 5 struct student { char num[6]; char name[8]; int score[4]; } stu[N]; void input(struct student stu[]); void print(struct student stu[]); main() { input(stu); } void input(struct student stu[]) { int i,j; for(i=0;i
A. stu[i].num
B. stu[i+1].num
C. stu[i].name
D. stu[j].name
查看答案
设有以下结构类型说明和变量定义,char占1字节,int占2字节,double占8字节,则变量a在内存所占字节数是【1】 struct stud{char num[6];int s[4]; double ave; } a;
若以下定义和语句, struct { int day; char mouth; int year;} b; 要引用结构体类型变量成员day可以表示为【1】。
若有如下结构体说明: struct STRU {int a, b;char c; double d;}; 现在定义t数组,要求t数组的每个元素为该结构体类型,请填空:【1】STRU t[20];
struct {int x; char *y;}tab={1,"ab"},*p=tab; 则:表达式p->x的结果为【1】。