A-A+
若有以下定义的语句: struct student { int age; int num;}
问题详情
若有以下定义的语句: struct student { int age; int num;}; struct student stu[3]={{1001,20},{1002,19},{1003,21}}; main() { struct student *p; p=stu; …} 则以下不正确的引用是()。
A.(p++)->num
B.p++
C.(*p).num
D.P=&stu.age.请帮忙给出正确答案和分析,谢谢!
参考答案
正确答案:D
解析:结构体成员的引用可以用“结构体变量名.成员名”或者“结构体变量指针->成员名”两种方式来引用。注意:结构体类型的变量、数组和指针变量的定义。