下列对结构及其变量定义错误的是( )。
A.struct My Struct { int num; char ch; }
B.struct MyStruct { int num; char ch; }My;
C.strut { int num; char ch; }My;
D.struct { int num; char ch; };
第1题:
若有结构体定义:
struct stu {int num;
char sex;
int age;
}a1,a2;
则下列语句中错误的是( )。
A.printf("%d%c,%d",a1);
B.a2.age=a1.age;
C.a1.age++;
D.a1.num=5;
第2题:
设有以下说明语句 struct num { int a; float b; }numl;则下面的叙述不正确的是______。
A.struct是结构体类型的关键字
B.struct num是用户定义的结构体类型
C.numl是用户定义的结构体类型名
D.a和b都是结构体成员名
第3题:
设有以下说明语句
struct stu
{int a;
float b;
} stutype;
则下面的叙述不正确的是
A.struct是结构体类型的关键字
B.struct stu是用户定义的结构体类型
C.stutype是用户定义的结构体类型名
D.a和b都是结构体成员名
第4题:
以下选项中不能正确把cl定义成结构体变量的是
A.typedef struct { int red; int green; int blue; } COLOR; COLOR cl;
B.struct color cl { int red; int green; int blue; }
C.struct color { int red; int green; int blue; } cl;
D.struct { int red; int green; int blue; } cl;
第5题:
下面结构体的定义语句中,错误的是( )。
A.struct ord{int x;int Y;int Z;};struet 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;
第6题:
下列说法错误的是( )。
A.下列结构体定义时,占据了5个字节的空间 struct student “nt num; int age; char sex; }
B.结构体的成员名可以与程序中的变量名相同
C.对结构体中的成员可以单独使用,它的作用相当于普通变量
D.结构体可以嵌套定义
第7题:
下面结构体的定义语句中,错误的是( )。
A.struct ord{int x;int y;int z;};struct ord a;
B.struct ord{int x;int y;int z;};ord a;
C.struct ord{int x;int y;int z;}a;
D.struct{int x;int y;int z;}a;
第8题:
下列语句段中,正确的是( )。
A.struct{int x;float y;int a[2];unsigned b[3];char name[10];};
B.struct stu{unsigned a[3];unsigned b[4];}x;int*p=&x.a;
C.struct stu{int a;float x[4];}y={1,1.0};float data=y.x;
D.struct nd{int a,b;unsigned c[2]=5;};
第9题:
此题为判断题(对,错)。
第10题:
下列对结构及其变量定义错误的是( )。
A.struct My Struct
B.struct MyStruct{ {int num; int num;char ch; char ch;} }My;
C.strut
D.struct{ {int num; int num;char ch; char ch;}My; };