下面结构体的定义语句中,错误的是( )。
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
【答案解析】
C语言中结构体变量的定义有3种方法:①定义结构体类型的同时定义结构体变量;②使用无名结构体类型定义结构体变量;③先定义结构体类型,后定义结构体变量。
提交答案
关闭