关于结构体变量定义错误的选项是哪一项?
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];
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];
举一反三
- 以下结构体说明和变量定义中,正确的是( )。 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: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT[] p;p=new POINT[100]; B: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT p[100]; C: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT p[]=new POINT[100]; D: struct POINT{ public double x;//横坐标 public double y;//纵坐标}POINT p=new POINT[100];
- {经过下述赋值后,变量x的数据类型是:int x=3;double y;y=(double)x;} A: int B: char C: float D: double
- 以下选项中,不能定义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];};