若已定义: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
若已定义: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
当p指向结构体变量stu时,以下哪种方法无法引用成员num( )。 A: stu.num B: (*p).num C: p->;nun D: p.num
当p指向结构体变量stu时,以下哪种方法无法引用成员num( )。 A: stu.num B: (*p).num C: p->;nun D: p.num
下列选项中不能够定义一个结构体类型变量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;
下列选项中不能够定义一个结构体类型变量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;
下列程序的输出结果第一行是_____,第二行是_______。 #include [iostream] #include [cstring] #include [iomanip] using namespace std; struct student { int num; char name[20]; double score; }; void fun(struct student *s); int main() { struct student stu={12345, "Zhangwei", 98.0}; cout[<stu.num<<","<<stu.name<<","<<stu.score<<endl; fun(&stu); cout<<stu.num<<","<<stu.name<<","<<stu.score<<endl; return 0; } void fun(struct student *s) { s-]num=23456; strcpy(s->name, "Liming"); s->score=88; }
下列程序的输出结果第一行是_____,第二行是_______。 #include [iostream] #include [cstring] #include [iomanip] using namespace std; struct student { int num; char name[20]; double score; }; void fun(struct student *s); int main() { struct student stu={12345, "Zhangwei", 98.0}; cout[<stu.num<<","<<stu.name<<","<<stu.score<<endl; fun(&stu); cout<<stu.num<<","<<stu.name<<","<<stu.score<<endl; return 0; } void fun(struct student *s) { s-]num=23456; strcpy(s->name, "Liming"); s->score=88; }
以下结构体的定义语句中,正确的是______。? 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;
以下结构体的定义语句中,正确的是______。? 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;
设有以下定义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;
设有以下定义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;
对结构体类型变量定义不正确的是( )。 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;
对结构体类型变量定义不正确的是( )。 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;
若有定义: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 age; int num;};struct student stu,*p;则以下正确的赋值语句是()。 A: p=stu; B: *p=*stu; C: *p=&stu; D: p=&stu;
分析下面的程序,下列说法中错误的是 ________ 。 #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; } }
分析下面的程序,下列说法中错误的是 ________ 。 #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; } }
引用结构体变量stu中num成员的方式是______________。
引用结构体变量stu中num成员的方式是______________。