A-A+
以下scanf函数调用语句中对结构体变量成员的不正确引用是 struct pupil { c
问题详情
以下scanf函数调用语句中对结构体变量成员的不正确引用是 struct pupil { char name[20]; int age int sex; } pup[5],*p; p=pup;
A.scanf("%s",pup[0].name);
B.scanf("%d",&pup[0].age);
C.scanf("%dT",&(p->sex));
D.scanf("%d",p->age);请帮忙给出正确答案和分析,谢谢!
参考答案
正确答案:D
解析:可用结构体变量名.数据成员名或者结构体指针->数据成员名两种方法来引用。注意:结构体类型的变量、数组和指针变量的定义。