A: char name[4];
B: char name[8];
C: char name[9];
D: int name[4];
E: int name[8];
F: int name[9];
举一反三
- 中国人的姓名通常不超过 4 个汉字,把姓名作为字符串,定义一个能够存放姓名的字符数组,写作: _______
- 下列结构体的定义正确的是( )。 A: student { int num; char name[10]; char sex; }; B: struct student { int num; char name[10]; char sex; } C: struct student { int num; char name[10]; char sex; }; D: struct student { int num char name[10] char sex };
- 下列定义中,属于指针数组的是( )? A: char *name[]={"abc","de"}; B: char (*p)[]; C: int (*p)[]; D: int (*name)[];
- 以下变量定义,错误的是: 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
- 对结构体类型变量定义不正确的是( )。 A: B: define STUDENT struct studentSTUDENT{char name;int num;}std; C: struct student{char name;int num;}stu; D: E: define struct student{char name;int num;}STD;STD stu; F: struct{char name;int num;}student;struct student stu;
内容
- 0
下列定义中,属于指针数组的是( )? A: char *name[]={"abc","de"}; B: char (*p)[]; C: int (*p)[]; D: int (*name)[];
- 1
在如下结构体定义中,不正确的是()。 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;
- 2
在如下结构体定义中,不正确的是○。 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];
- 3
以下结构体的定义语句中,正确的是______。? struct student {int num; char name[10];int age;}stu;|struct {int num; char name[10];int age;}student; struct student stu;|struct student {int num; char name[10]; int age;}; student stu;|struct student {int num; char name[10];int age;};stu;
- 4
能将字符串存储到name数组中的选项有() A: char name[20], *p;p=name;gets(name); B: char name[20], *p;p=name;gets(p); C: char name[20], *p;p=name;scanf("%s",name); D: char name[20], *p;p=name;scanf("%s",p);