下列选项中不能正确定义结构体的是_______。A.typedef structB.struct color cl {int red; {int r

题目

下列选项中不能正确定义结构体的是_______。

A.typedef struct

B.struct color cl {int red; {int red; int green; int green; int blue; int blue; }COLOR; }; COLOR cl;

C.struct color

D.struct {int red; {int red; int green; int green; int blue; int blue; }cl; }cl;

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

以下选项中不能正确把c1定义成结构体变量的是______。

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; } c l;

D.struct { int red; int green; int blue; } c l;


struct color cl { int red; int green; int blue; };

第2题:

9、以下选项中不能正确把c1定义成结构体变量的是______。

A.typedef struct { int red; int green; int blue; } COLOR; COLOR cl;

B.struct color { int red; int green; int blue; } c l;

C.struct color cl { int red; int green; int blue; };

D.struct { int red; int green; int blue; } c l;


B 解析:结构体类型的定义格式为: stract结构体名 成员说明列表}; 结构体变量的定义有3种形式:第一种,定义结构体类型的同时定义结构体变量,如: street结构体名{成员说明列表}变量;第二种,先定义一个结构体类型,然后使用该类型来定义结构体变量,如:strect student{成员说明列表};student变量;第三种,定义一个无名称的结构体类型的同时定义结构体变量,如:strect student{成员说明列表}变量;。

第3题:

以下选项中不能正确把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;


B

第4题:

4、以下选项中不能正确把cl定义成结构体变量的是

A.struct color cl { int red; int green; int blue; }

B.typedef struct { int red; int green; int blue; } COLOR; COLOR cl;

C.struct color { int red; int green; int blue; } cl;

D.struct { int red; int green; int blue; } cl;


B

第5题:

以下选项中不能正确把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; }c1;


B

第6题:

14、以下选项中不能正确把cl定义成结构体变量的是

A.struct color cl { int red; int green; int blue; }

B.typedef struct { int red; int green; int blue; } COLOR; COLOR cl;

C.struct color { int red; int green; int blue; } cl;

D.struct { int red; int green; int blue; } cl;


B 解析:选项A)是把结构体类型改名后定义为变量cl。选项C),D)则是在定义结构体类型时定义变量,而选项B)不符合结构体类型定义的语法规则。

第7题:

以下选项中不能正确把cl定义成结构体变量的是

A.struct color cl { int red; int green; int blue; }

B.typedef struct { int red; int green; int blue; } COLOR; COLOR cl;

C.struct color { int red; int green; int blue; } cl;

D.struct { int red; int green; int blue; } cl;


B

第8题:

以下选项中不能正确把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;


正确答案:B
解析:本题选项A)、C)、D)是定义结构体及其变量的三种正确的形式,能正确将c1定义为结构体变量。选项B)错误。

第9题:

以下选项中不能正确把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;


正确答案:B
解析:选项A)是把结构体类型改名后定义为变量cl。选项C),D)则是在定义结构体类型时定义变量,而选项B)不符合结构体类型定义的语法规则。