if(q->price>pb->price)__pb=q__
___temp=*pb;*pb=*(pbook+i);*(pbook+i)=temp;__;
}
}
printbook(structbook*pbook)
{printf(“%-20s%6d\n”,pbook->name,pbook->price);}
88.以下对结构体类型变量的定义中,不正确的是。
A)typedefstructaaB)#defineAAstructaa
{intn;AA{intn;
floatm;floatm;
}AA;}td1;
AAtd1;
C)structD)struct
{intn;{intn;
floatm;floatm;
}aa;}td1;
structaatd1;
89.对于设有下列说明,则不正确的是______。
structex
{intx;floaty;charz;}example;
A)struct是结构体类型的关键字B)example是结构体类型名
C)x,y,z都是结构体成员名D)structex是结构体类型
90.以下选项中不能正确把c1定义成结构体变量的是。
A)typedefstructB)structcolorc1
{intred;{intred;
intgreen;intgreen;
intblue;intblue;
}COLOR;};
COLORc1;
C)structcolorD)struct
{intred;{intred;intgreen;
intgreen;intblue;
intblue;}c1;
}c1;
91.已知:
structsk
{inta;floatb;
}data,*p;
若有p=&data,则对data中成员a的正确引用是________。
A)(*p).data.aB)(*p).aC)p->data.aD)p.data.a
92.若有说明:
typedefstruct
{intn;charc;doublex;}STD;
则能正确定义结构体数组并赋初值的语句是。
A)STDtt[2]={{1,'A',62},{2,'B',75}};
B)STDtt[2]={1,"A",62,2,"B",75};
C)structtt[2]={{1,'A'},{2,'B'}};
D)structtt[2]={{1,"A",62.5},{2,"A",75.0}};
93.有说明:
structperson{charname[9];intage};
structpersonclass[5]={"Joju",17,"Paul",19,"Mary",18,"Adam",16};
能输出字母M的语句是____。
A)printf(“%c\n”,class[3].name);
B)printf(“%c\n”,class[3].name[1]);
C)printf(“%c\n”,class[2].name[1]);
D)printf(“%c\n”,class[2].name[0]);
94.下列程序的输出结果是__6__。
structabc
{inta,b,c;};
main()
{structabcs[2]={{1,2,3},{4,5,6}};intt;
t=s[0].a+s[1].b;
printf(“%d”,t);
}
95.有以下说明和定义语句:
structstudent{intage;charnum[8];};
structstudentstu[3]={{20,"200401"},{21,"200402"},{19,"200403"}};
structstudent*p=stu;
引用结构体变量成员的错误表达式是______。
A)(p++)->numB)p->numC)(*p).numD)stu[3].age
96.当说明一个结构体变量时系统分配给它的内存空间是。
A)各成员所需内存量的总和B)结构中第一个成员所需内存量
C)成员中占内存量最大者所需的容量D)结构中最后一个成员所需内存量
97.当说明一个共用体变量时系统分配给它的内存空间是。
A)各成员所需内存量的总和B)结构中第一个成员所需内存量
C)成员中占内存量最大者所需的容量D)结构中最后一个成员所需内存量
98.有以下说明和定义语句:
structstudent{intnum,age;};
structstudentstu[3]={{1001,20},{1002,19},{1003,21}};
structstudent*p=stu;
错误表达式是______。
A)(p++)->numB)p->ageC)(*p).numD)p=&stu.age
99.已知学生结构为:
structstudent{intno;charname[20];charsex;
struct{intyaer,month,day;}birth;
}s;
以下______是正确的赋值方式。
A)year=1984;month=11;day=11;
B)birth.year=1984;birth.month=11;birth.day=11;
C)s.year=1984;s.month=11;s.day=11;
D)s.birth.year=1984;s.birth.month=11;s.birth.day=11;
100.若有以下程序段:
structdent{intn;int*m;};
inta=1,b=2,c=3;
structdents[3]={{101,&a},{102,&b},{103,&c}};
structdent*p=s;
则以下表达式中值为2的是_____。
A)(p++)->mB)*(p++)->mC)(*p).mD)*(++p)->m
101.定义:
typedefARRAY1[10];
则整型数组a[10]、b[10]、t[10]可以定义为__ARRAYa,b,c;_____。
102.若已建立下面的链表结构,指针、分别指向图中所示结点,则不能将所指的结点插入到链表尾的一组语句是__。
A)q->next=NULL;p=p->next;p->next=q;
B)p=p->next;q->next=p->next;p->next=q;
C)p=p->next;q->next=p;p->next=q;
D)p=(*p).next;(*q).next=(*p).next;(*p).next=q;
103.如何定义如下形式的链表?
structxxxx
{intnum;charname[20];intage;charaddr[20];
structxxxx*next;
};
104.若要使STPs;等价于char*s;,应进行如下说明。
A)typedefSTPchar*s;B)typedef*charSTP
C)typedrfSTP*char;D)typedefchar*STP;
105.若有如下定义,则变量a所占的内存字节数是_10__
.uoionU{charst[6];inti;longl;};
structA{intc;unionUu;}a;
106.设有定义:
enumt1{a1,a2=7,a3,a4=15}time;
则枚举常量a1和a3的值分别是___0_8__。
107.以下枚举类型的定义中正确的是_______。
A)enuma={one,two,three};
B)enuma{one,two,three};
C)enuma={“one”,“two”,“three”};
D)enuma{“one”,“two”,“three”};
108.设inti=2,j=1,k=3;表达式i&&(i+j)&k|i+j的值为___1____。
109.设intb=2;表达式(b<<2)/(b>>1)的值是___8____。
110.C语言可以处理的文件类型是_________。
A)文本文件和数据文件B)文本文件