以下选项中,能定义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;
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;
B
举一反三
- 以下选项中,能定义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: 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];};
- 以下选项中,能定义s为合法的结构体变量的是( ). A: typedef struct CLASS{double a;char b[5];}C; B: typedef CLASS{double a;char b[5];}CLASS s; C: struct{double a;char b[10];}s; D: struct CLASS{double a;char b[5];}CLASS s;
- 以下结构体说明和变量定义中,正确的是( )。 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;
内容
- 0
有以下程序段,输出结果为()。 #include <stdio.h> struct s { int a; char b; double f; }; main() { printf("%d",sizeof(struct s)); }
- 1
若有以下语句“typedef<br/>struct T{int g; char h; } S;”。以下叙述中正确的是( )。 A: T是struct类型的变量 B: S是struct<br/>S类型的变量 C: 可用T定义结构体变量 D: 可用S定义结构体变量
- 2
如有变量的定义 char s[]=”abc”; 语句 char *p=s; 是合法的
- 3
设有以下语句typedef struct S{ int g; char h;} T;则下面叙述中正确的是( )。 A: 可用S定义结构体变量 B: S是struct类型的变量 C: 可以用T定义结构体变量 D: T是struct S类型的变量
- 4
关于结构体变量定义错误的选项是哪一项? A: struct player { int id; char name[32]; double x; double y;};struct player npc[100]; B: struct player { int id; char name[32]; double x; double y;} npc[100]; C: struct { int id; char name[32]; double x; double y;} npc[100]; D: struct player { int id; char name[32]; double x; double y;};player npc[100];