若有以下结构体定义,则是正确的引用或定义。struct example{ int x; int y;}v1;

admin2010-05-22  18

问题 若有以下结构体定义,则是正确的引用或定义。struct example{   int x;    int y;}v1;

选项 A、example.x=10
B、examplev2.x=10
C、struct v2;v2.x=10
D、struct example v2={10};

答案8

解析 在定义结构体变量时,不能只用结构体名example或关键字struct进行定义,必需要用结构体类型名struct example定义,在引用结构体成员变量时,需要用结构体变量名进行引用,所以选D。
转载请注明原文地址:https://kaotiyun.com/show/wRWp777K
0

最新回复(0)