A: struct abc{ int n;double m );struct abc x, y;
B: struct ABC{ int n;double m; }struct ABC x, y;
C: typedef struct abc{ int n;double m; }ABC;ABC x,y;
D: D) struct abc{ int n;double m; };abc x,y;
举一反三
- 以下结构体说明和变量定义中,正确的是( ) A: typedef struct abc{ int n;double m; }ABC;ABC x,y; B: struct abc{ int n;double m };struct abc x, y; C: struct ABC{ int n;double m; }struct ABC x, y; D: struct abc{ int n;double m; };abc x, y;
- 以下正确的函数原型声明(自定义函数首部)是( ). A: double abc(int x;int y) B: double abc(int x,y); C: double abc(int x,int y) D: double abc(int x,int y);
- 以下选项中,能定义s为合法的结构体变量的是 。 A: typedef struct abc { double a ; char b[10]; }s; B: struct { double a ; char b[10]; }s; C: struct ABC{ double a ; char b[10]; } ; ABC s; D: typedef struct ABC{ double a ; char b[10]; } ; ABC s;
- 以下选项中,能定义s为合法的结构体变量的是()。 A: typedef struct 123 B: double a; C: char b[10]; D: s; E: struct F: double a; G: char b[10]; H: s; I: struct ABC J: double a; K: char b[10]; L: ABC s; M: typedef ABC N: double a; O: char b[10]; P: ABC s;
- 若程序中有以下的说明和定义:struct abc{ int x;char y; }struct abc s1,s2;则会发生的情况是______。
内容
- 0
定义struct s {int x; char y[6];} s1;, 正确的赋值是 A: s1.y=”abc”; B: s1->y=”abc”; C: strcpy(s1.y,”abc”); D: s1.strcpy(y,”abc”);
- 1
以下选项中,不能定义s为合法的结构变量的是 。 A: struct abc{double a;char b[10];}s; B: struct{double a;char b[10];}s; C: struct abc{double a;char b[10];};struct abc s; D: struct s{double a;char b[10];};
- 2
函数f()定义如下,该函数返回值的数据类型是______。 struct ABC int a;int b;int c;; struct ABC *f(struct ABC abc[2]) return (abc);
- 3
写出下面程序的运行结果。struct abc{ int a; float b; char *c; }; int main(void) { struct abc x = {23,98.5,"wang"}; struct abc *px = &x; printf("%d, %s, %.1f, %s \n", x.a, x.c, (*px).b, px->c ); return 0;}
- 4
设有以下说明语句,则下面的叙述正确的是( )。struct abc{int m; float n;}stype; A: struct是结构体类型的关键字 B: abc是用户定义的结构体名 C: m和n都是结构体成员 D: stype是用户定义的结构体变量名 E: struct abc 是结构体类型名