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