题目内容

设int类型占用4个字节的内存,若有下面的说明和定义structtest{intml;charm2;floatm3;};则sizeof(structtest)的值是()

A. 8
B. 9
C. 10
D. 11

查看答案
更多问题

有以下程序structstu{charnum[10];floatscore[3];};main(){structstus[3]={{“20021”,90,95,85},{“20022”,95,80,75},{“20023”,100,95,90}},*p=s;inti;floatsum=0;for(i=0;i<3;i++)sum=sum+p->score[i];printf(“%6.2f\n”,sum);}程序运行后的输出结果是()

A. 260.00
B. 270.00
C. 280.00
D. 285.00

若有以下说明和定义typedefintINTEGER;INTEGERp,*q;以下叙述不正确的是()

A. p是int型变量
B. p是基类型为int的指针变量
C. q是基类型为int的指针变量
D. 程序中可用INTEGER代替int类型名

有以下程序structSTU{charname[10];intnum;};voidf1(structSTUC){structSTUb={“LiSiGuo”,2042};C=b;}voidf2(structSTU*C){structSTUb={“SunDan”,2044};*C=b;}main(){structSTUa={“YangSan”,2041},b={“WangYin”,2043};f1(a);f2(&b);printf(“%d%d\n”,a.num,b.num);}执行后的输出结果是()

A. 20412044
B. 20412043
C. 20422044
D. 20422043

有以下程序structSTU{charname[10];intnum;intScore;};main(){structSTUs[5]={{“YangSan”,20041,703},{“LiSiGuo”,20042,580},{“wangYin”,20043,680},{“SunDan”,20044,550},{“Penghua”,20045,537}},*p[5],*t;inti,j;for(i=0;i<5;i++)p[i]=&s[i];for(i=0;i<4;i++)for(j=i+1;j<5;j++)if(p[i]->Score>p[j]->Score){t=p[i];p[i]=p[j];p[j]=t;}printf(“5d%d\n”,s[1].Score,p[1]->Score);}执行后输出结果是()

A. 550550
B. 680680
C. 580550
D. 580680

答案查题题库