A-A+
若有以下结构体定义 则是正确的引用或定义。 Struct example { int x;
问题详情
若有以下结构体定义,则是正确的引用或定义。 Struct example { int x; int y; }V1;
A.example.x=10
B.example V2.x=10
C.structv2;v2x=10
D.struct examplev2={10};请帮忙给出正确答案和分析,谢谢!
参考答案
正确答案:D
解析:在定义结构体变量时,不能只用结构体名example或关键字struct进行定义,必需要用结构体类型名structexample定义,在引用结构体成员变量时,需要用结构体变量名进行引用,所以选D。