下面结构体的定义语句中,错误的是( )。

admin2020-11-27  19

问题 下面结构体的定义语句中,错误的是(    )。

选项 A、struct ord{int x;int y;int z;);structord a;
B、struct ord{int x;int y;int z;)structord a;
C、struct ord{int x;int y;int z;}a;
D、struct{int x;int y;int z;}a;

答案B

解析 C语言中结构体变量的定义有3种方法:①定义结构体类型的同时定义结构体变量,如C项;②使用无名结构体类型定义结构体变量,如D项;③先定义结构体类型,后定义结构体变量,如A项。
转载请注明原文地址:https://kaotiyun.com/show/Sa3p777K
0

最新回复(0)