举一反三
- 设有变量定义 struct stu { int age; int num; }std,*p=&std; 能正确引用结构体变量std中成员age的表达式是_____
- 若有以下语句: struct student { int age; int num; } std,*p; p=&std; 则对结构体变量std中成员age的引用方式不正确的是()。
- 设有如下定义: struct st{ char name[12]; int age; char sex; }stu[10],*p=stu;以下语句错误的是( )。 A: scanf("%d",p->age); B: scanf("%s",std[0].name); C: scanf("%d",&std[1].age); D: scanf("%c",&(p->sex);
- 设有如下定义: struct st{ char name[12]; int age; char sex; }stu[10],*p=stu;以下语句错误的是( )。 A: scanf("%d",p->age); B: scanf("%s",std[0].name); C: scanf("%d",&std[1].age); D: scanf("%c",&(p->sex);
- 以下对结构体变量stu成员age的非法引用是( )。 struct<br/>student {<br/>int num;<br/>int age; }; struct<br/>student stu,*p=&stu; A: stu.age B: (*p).age C: student.age D: p->age
内容
- 0
下列选项中不能够定义一个结构体类型变量stu的是 。 A: struct student { int num; int age; } stu; B: struct student { int num; int age; }; student stu; C: struct {int num; int age; } stu; D: struct student {int num; int age; }; struct student stu;
- 1
以下对结构变量stu1中成员age的非法引用是( )struct student{ int age; int num;};struct student stu1, *p;p=&stu1; A: stu1.age B: student.age C: p->age D: (*p).age
- 2
以下对结构变量stu1中成员age的非法引用是( )struct student{ int age; int num;};struct student stu1, *p;p=&stu1; A: stu1.age B: student.age C: p->age D: (*p).age
- 3
对结构体类型变量定义不正确的是( )。 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;
- 4
以下对结构变量stu1中成员age的非法引用是( )。struct student{ int age;int num;}stu1,*p;p=&stu1; A: .(*p).age B: stu1.age C: p->age D: student.age