A-A+
以下scanf函数调用语句中对结构体变量成员的引用不正确的是 struct pupil {
问题详情
以下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
解析:考查结构体成员变量的引用方法。可用结构体变量名.数据成员名或者结构体指针->数据成员名两种方法来引用。 结构体类型的变量、数组和指针变量的定义。