A: Stu*p[5];
B: Stu(*p)[5];
C: (Stu*)p[5];
D: Stu*p();
举一反三
- 若有定义:struct student{ int age; int num;};struct student stu,*p;则以下正确的赋值语句是()。 A: p=stu; B: *p=*stu; C: *p=&stu; D: p=&stu;
- 若已定义:struct Student {int num; char name[20];}stu,*p; p=&stu;,要访问stu中的num成员,可使用【】。 A: *stu.num B: p->;num C: stu->;num D: p.num
- 有下列结构体,对该结构体变量stu的成员项引用不正确的是( )。 structstudent { int m; Float n; } stu ,*p=&stu; A: stu.n B: p->m C: (*p).m D: p.stu.n
- 若有以下定义和语句: struct student {int num ;int age;}; struct student stu[3]={{l001,20},{1002,19},{1003,2l}}; main() {struct student *p;p=stu; ... } 则下列引用中不正确的是
- 2.structstudent{ int number;char name[10];};struct student *p,stu[2];p=stu;对stu和p的操作,错误的是: A: p++; B: stu++; C: p+1; D: stu+1;
内容
- 0
若有以下说明和定义语句,则下面引用形式中不正确的是 ( )。 struct student { int age; int num; }; struct student stu[3]={{1001,20},{1002,19},{1003,21}}; struct student *p; p=stu;
- 1
若有以下定义语句,则以下错误的引用是( )。 struct student {int num,age;}; struct student stu[3]={{101,20},{102,19},{103,18}},*p=stu;
- 2
设有以下定义struct student{ int age; int num;}stu[5],*p=stu;int i;stu[0].num=10;则以下语句不正确的是 A: i=p->num; B: i=stu[0].num; C: i=(*p).num; D: p=&student.num;
- 3
以下对结构体变量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
- 4
分析下面的程序,下列说法中错误的是 ________ 。 #define NULL 0 #include "conio.h" struct stu { long num; char name[20]; int score; struct stu * next; }; int main() { struct stu *head,*p,*pa,*pb,*pc; pa=(struct stu *)malloc(sizeof(struct stu)); pb=(struct stu *)malloc(sizeof(struct stu)); pc=(struct stu *)malloc(sizeof(struct stu)); scanf("%ld%s%d",&pa->num,pa->name,&pa->score); scanf("%ld%s%d",&pb->num,pb->name,&pb->score); scanf("%ld%s%d",&pc->num,pc->name,&pc->score); head=pa; pa->next=pb; pb->next=pc; pc->next=NULL; p=head; while(p!=NULL) { printf("%ld,%s,%d\n",p->num,p->name,p->score); p=p->next; } }