题目内容

有以下程序#include#includetypedef struct{charname[10];charsex;intage;}STU;voidfun(STU*t){strcpy((*t).name,"Tong");(*t).age++;}main(){STUs[2]={"Hua",'m',18,"Qin",'f',19};fun(s+1);printf("%s,%d,%s,%d\n",s[0].name,s[0].age,s[1].name,s[1].age);}程序运行后的输出结果是

A. Hua,18,Tong,20
B. Hua,18,Qin,19
C. Tong,19,Qin,19
D. Hua,19,Tong,19

查看答案
更多问题

有以下程序#include#includetypedef struct stu{charname[10];chargender;intscore;}STU;voidf(STUc){strcpy(c.name,"Qian");c.gender='f';c.score=350;}main(){STUa={"Zhao",'m',290},b;b=a;f(b);printf("%s,%c,%d,",a.name,a.gender,a.score);printf("%s,%c,%d\n",b.name,b.gender,b.score);}程序的运行结果是

A. Zhao,m,290,Zhao,m,290
B. Zhao,m,290,Qian,m,290
C. Zhao,m,290,Qian,m,350
D. Zhao,m,290,Qian,f,350

为了建立如图所示的存储结构(即每个结点含两个域,data是数据域,next是指向结点的指针域)则在()处填入的选项是()。structlink{chardata;()}node;datanext

A. structlink*next;
B. linknext;
C. link*next;
D. structlinknext;

有以下程序#includetypedef struct stu{charname[10];chargender;intscore;}STU;voidf(STUa,STU*b,STUc){*b=c=a;printf("%s,%c,%d,",b->name,b->gender,b->score);printf("%s,%c,%d,",c.name,c.gender,c.score);}main(){STUa={"Zhao",'m',290},b={"Qian",'f',350},c={"Sun",'m',370};f(a,&b,c);printf("%s,%c,%d,",b.name,b.gender,b.score);printf("%s,%c,%d\n",c.name,c.gender,c.score);}程序运行后的输出结果是

A. Zhao,m,290,Zhao,m,290,Zhao,m,290,Sun,m,370
B. Zhao,m,290,Zhao,m,290,Zhao,m,290,Zhao,m,290
C. Zhao,m,290,Zhao,m,290,Qian,f,350,Sun,m,370
D. Zhao,m,290,Zhao,m,290,Qian,f,350,Zhao,m,290

有以下程序#include#includetypedef struct stu{charname[10];chargender;intscore;}STU;voidf(charname[10],chargender,intscore){strcpy(name,"Sun");gender='m';score=370;}main(){STUb={"Zhao",'m',290},a={"Qian",'f',350};b=a;printf("%s,%c,%d,",b.name,b.gender,b.score);f(b.name,b.gender,b.score);printf("%s,%c,%d\n",b.name,b.gender,b.score);}程序运行后的输出结果是

A. Qian,f,350,Sun,f,350
B. Qian,f,350,Qian,f,350
C. Qian,f,350,Sun,m,370
D. Zhao,m,290,Sun,m,370

答案查题题库