以下选项中不能正确把cl定义成结构体变量的是______。 1.typedefstruct {intred; int green; int blue; } COLOR; COLOR cl; 2.structcolor cl { int red; int green; int blue; }; 3.structcolor { int red; int green; int blue; }cl; 4.struct {int red; int green; intblue; }c1;
举一反三
- 以下选项中不能正确把cl定义成结构体变量的是______。 1.typedefstruct {intred; int green; int blue; } COLOR; COLOR cl; 2.structcolor cl { int red; int green; int blue; }; 3.structcolor { int red; int green; int blue; }cl; 4.struct {int red; int green; intblue; }c1;
- 以下选项中不能正确把cor定义成结构体变量的是______。 A: struct{ int red; int green; int blue;} cor; B: struct color cor{ int red; int green; int blue;}; C: struct color{ int red; int green; int blue;} cor; D: typedef struct{ int red;int green;int blue;}COLOR;COLOR cor;
- 以下选项中不能正确把cl定义成结构体变量的是______。1.typedefstruct{intred;intgreen;intblue;}COLOR;COLORcl;2.structcolorcl{intred;intgreen;intblue;};3.structcolor{intred;intgreen;intblue;}cl;4.struct{intred;intgreen;intblue;}c1;
- 阅读下面的程序, 请写出程序的输出结果 。 #include<iostream> using namespace std; int main () { enum Color {Red,Green,Blue}; Color color; color=Red; cout<<color<<","; color=Green; cout<<color<<","; color=Blue; cout<<color<<","; cout<<Red+Green+Blue<<endl; return 0; }
- 下面对枚举变量的定义中,正确的是( )。 A: enum color {red, blue, grenn} a, b; B: enum color={red, blue, green} a,b; C: enum color={"red", "blue", "green"} a, b; D: enum color {red, blue, green} a, b;