定义结构体类型变量teach1,不正确的是()。
A、struct teacher {int num; int age; }; struct teacher teach1;
B、struct teacher {int num; int age; }teach1;
C、struct {int num; int age; }teach1;
D、struct {int num; int age; }teacher; struct teacher teach1;
A、struct teacher {int num; int age; }; struct teacher teach1;
B、struct teacher {int num; int age; }teach1;
C、struct {int num; int age; }teach1;
D、struct {int num; int age; }teacher; struct teacher teach1;
第1题
A、struct student { int num; int age; } stud1;
B、struct { int num; int age; } stud1;
C、typedef struct student { int num; int age; }STUDENT; STUDENT stud1;
D、struct { int num; int age; }; struct student stud1;
第2题
A、struct student { long no; double score; };
B、struct stud[20] { long no; double score; };
C、struct student { long no; double score; }stud[20];
D、struct { long no; double score; } stud[100];
第3题
struct STD
{ char name[10];
int age;
char sex;
} s[5],*ps;
ps=&s[0];
则以下 scanf 函数调用语句中错误引用结构体变量成员的是
A)scanf("%s",s[0].name);
B)scanf("%d",&s[0].age);
C)scanf("%c",&(ps->sex));
D)scanf("%d",ps->age);
第5题
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];
第6题
A、结构体类型是一种比较复杂的值类型。
B、每个结构体类型定义后,语言都隐式地为它提供一个无参数的构造函数,这个构造函数把结构的每个成员都设置为该成员类型的默认值。
C、要对结构体变量进行显示初始化,必须定义结构体的带参数构造函数。
D、定义了结构体类型的带参数构造函数之后,系统将不再为之创建无参数的构造函数。
第8题
A、year=1976
B、birthday.year=1976
C、w1.birthday.year=1976
D、w1.year=1976
第9题
A、不正确
B、不正确
C、不正确
D、正确
第10题
有以下结构体说明和变量定义,如图所示,指针p、q、r分别指向一个链表中的三个连续结点。现要将q和r所指结点的先后位置交换,同时要保持链表的连续,以下错误的程序段是 struct node { int data; struct node *next; }*p, *q, *r;
A、r->next=q; q->next=r->next; p->next=r;
B、q->next=r->next; p->next=r; r->next=q;
C、p->next=r; q->next=r->next; r->next=q;
D、q->next=r->next; r->next=q; p->next=r;
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!