![](https://static.youtibao.com/asksite/comm/h5/images/m_q_title.png)
若程序中有下面的说明和定义:struct abc{int x;char y;}struct abc s1,s2;则会发生的情况是()。
A.编译出错
B.程序将顺利编译、连接、执行
C.能顺利通过编译、连接,但不能执行
D.能顺利通过编译,但连接出错
![](https://static.youtibao.com/asksite/comm/h5/images/solist_ts.png)
A.编译出错
B.程序将顺利编译、连接、执行
C.能顺利通过编译、连接,但不能执行
D.能顺利通过编译,但连接出错
A.12
B.16
C.14
D.9
设有以下说明语句,则下面的叙述中不正确的是( )。
struct ex
(int x;float y;char z; )example;
(A)struct结构体类型的关键字 (B)example是结构体类型名
(C)x,y,z都是结构体成员名 (D)struct ex是结构体类型
A.struct是结构体类型的关键字
B.example是结构体类型名
C.x,y,z都是结构体成员名
D.struct ex是结构体类型
struc node {int data; struct node*next; }*P,*q,*r; 现要将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=P;
D.q->next=r->next;r->next=q;p->next=r;
有以下说明和定义语句:
struct student
{int age;char num[8];);
struct student stu[3]={{20,"200401"},(21,"200402"),(19,"200403"}};
struct student*p=stu;
以下选项中引用结构体变量成员的表达式错误的是( )。
(A)(p++)->num (B)p->num (C)(*p).num (D)stu[3].age
设有以下结构类型说明和变量定义,则变量a在内存所占字节数是______。
Struct stud
{ char hum[6];
int s[4];
double ave;
} a,*p;
设有以下结构类型说明和变量定义,则变量a在内存所占字节数是______。
Struct stud
{ char hum[6];
int s[4];
double ave;
} a,*p;
若STUDENT student1,student2;(student1,student2为结构体变量)为正确定义,那么在此之前应做( )定义。
(A)struct
{char name[20];
int num;
}STUDENT;
(B)struct STUDENT
{char name[20];
int num;
};
(C)typedef struct
{char name[20];
int num;
}STUDENT;
(D)typedef struct STUDENT
{char name[20];
int num;
};
A.a,next=q;
B.p.next=&b;
C.p->next=&b;
D.(*p).next=q;