全部问题 > 当前问题

老师,是不是结构体变量具有成员属性的全部属性?

柴锡翠 2017-8-16 17:10:35

共 2 个回答

qqq 2017-8-17 11:27:29

是的。

柴锡翠 2017-8-17 15:46:01

回复 qqq:好的


下面结构体的定义语句中,错误的是 ______ 。
A. struct ord {int x;int y;int z;};struct ord a;
B. struct ord {int x;int y;int z;}struct ord a;
C. struct ord {int x;int y;int z;} a;
D. struct {int x;int y;int z;} a;
答案:B
解析:A选项中,先定义了结构体类型ord,然后用struct ord类型定义了变量a。C选项把A选项的两件事坐了合并。D选项没有定义类型,直接定义了结构体变量a,三者都正确,只有B不正确。因此选B。