A-A+
根据下列定义 能打印出字母P的语句是()。 struct stu{char name[10]
问题详情
根据下列定义,能打印出字母P的语句是()。
struct stu{char name[10];
int age;
};
struct stu s[10]={"John",11,
"Pau1",12,
"Mary",11,
"adam",12
};
A.primf("%c",s[3].name};
B.primf("%c",s[3].name[1]);
C.printf("%c",s[2].name[1]);
D.printf("%c",s[1].name[0]);
参考答案
正确答案:D
解析:本题主要考查按结构数组元素方式引用结构成员。字母P为"Paul"的第一个字母,是结构体 s[1]的name成员的第一个元素的值,即s [1].name[0]的值。