A: struct ss { char flag; float x; } ; ss a,b;
B: struct ss{ char flag;float x;}; struct ss a,b;
C: struct { char flag; float x; }ss; ss a,b;
D: struct { char flag;float x;}ss;struct ss a,b;
举一反三
- 下列结构体类型说明和变量定义中,正确的是 A: struct SS{char flag;float x;} struct SS a,b; B: struct {char flag;float;}SS; SS a,b; C: struct ss{char flag;float x;}; struct ss a,b; D: typedef{char flag;float x;}SS; SS a,b;
- 设有如下定义:struct s1{int x;int y;};struct s2{int a;float b;struct s1 p;}ss;以下引用正确的是( )。 A: (ss).x B: (ss)->p.a C: ss.p->a D: ss.p.x
- 在如下结构体中,不正确的是( )。 A: struct student {char name[10]; float score; }; B: struct stu[5] {char name[10]; float score; }; C: struct student {char name[10]; float score; } stu[5]; D: struct {char name[10]; float score; }stu[5];
- 在如下结构体定义中,不正确的是()。 A: struct teacher{ int no; char name[10]; float salary;}; B: struct tea[20]{ int no; char name[10]; float salary;}; C: struct teacher{ int no; char name[10]; float salary; }tea; D: struct{ int no; char name[10]; float salary; }tea;
- 在如下结构体定义中,不正确的是○。 A: struct student { int no; char name[10]; float score; } B: struct stud[20] { int no; char name[10]; float score; } C: struct student { int no; char name[10]; float score; }stud[20]; D: struct{int no;char name[10];float score;}stud[100];
内容
- 0
以下语句中存在语法错误的是 A)char ss[6][20]; ss[1]="right?"; B)char ss[][20]={"right?"}; C)char *ss[6]; ss[1]="right?"; D)char *ss[]={"right?"};
- 1
以下对结构体类型的变量定义中不正确的是 。 A: B: define STUD struct student STUD {long num; char name[20]; char sex; float score;}; STUD stud1,stud2; C: struct student {long num; char name[20]; char sex; float score; }stud1,stud2; D: struct {long num; char name[20]; char sex; float score; } stud1,stud2; E: struct {long num; char name[20]; char sex; float score; }student;struct student stud1,stud2;
- 2
设有如下定义:struct ss{char name [10];int...std;下面各输入语句中错误的是()。
- 3
下列语句中存在语法错误的是______。 A: char ss[]={ "right? "}; B: char ss[ ][20]={ "right? "}; C: char *ss[6]; ss[1]= "right? "; D: char ss[6][20]; ss[1]= "right? ";
- 4
下列字符数组定义和赋值正确的是( ) A: char ss[]={'abcd'}; B: char ss[4]="abcdef"; C: char ss[5]={ "abcd"}; D: char ss[5]= 'abcd';