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;
举一反三
- 以下选项中,能定义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;
- 以下选项中,不能定义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];};
- 关于结构体变量定义错误的选项是哪一项? 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];
- 设有定义:struct {char mark[12]; double num1...um2;typedef的作用是( )。
内容
- 0
有以下程序段,输出结果为()。 #include <stdio.h> struct s { int a; char b; double f; }; main() { printf("%d",sizeof(struct s)); }
- 1
结构体定义正确的是? A: struct mater { char name[20]; }; B: struct mater { char name[20]; }mater; C: typedef struct{ char name[20]; }mater; D: typedef struct{ char name[20]; };
- 2
若有以下语句“typedef<br/>struct T{int g; char h; } S;”。以下叙述中正确的是( )。 A: T是struct类型的变量 B: S是struct<br/>S类型的变量 C: 可用T定义结构体变量 D: 可用S定义结构体变量
- 3
设有以下语句typedef struct S{ int g; char h;} T;则下面叙述中正确的是( )。 A: 可用S定义结构体变量 B: S是struct类型的变量 C: 可以用T定义结构体变量 D: T是struct S类型的变量
- 4
以下变量定义,错误的是: A: struct student{int num, char name[20];} s; B: struct {int num, char name[20];} s; C: struct student{int num, char name[20];}; struct student s; D: struct student{int num, char name[20];} ; student s