题目内容

通过被调函数利用指针变量给结构体变量输入数据,在主函数中输出结构体数据。根据题目填空。#includestruct worker{char *name;int salary;};void getdata(_______________){ gets(p->name);scanf("%d",&p->salary);}void main(void){ struct worker wk;getdata(&wk);printf("%s,%d\n",_______,wk.salary);}

查看答案
更多问题

下程序的运行结果是:____,____,____。struct atype{ int m;char *pn;}tab[2]={{1,"ab"},{2,"cd"}},*p=tab;void main(){ printf("%d",tab[1].m);printf("%c",*p->pn);printf("%c",*(++p)->pn);}

有程序如下定义,输出结果为____。#include struct info{ int x,float y;char z} st={10,10.0,'a’};void main( ){ struct st *pa=&st;printf(“%d ”,s.x);printf(“%c “,p->z);printf(“%.2f “,(*p)->y);}

有程序如下定义,输出结果_______________。#include struct info{ int k; char *s; }t;void f(struct info t){ t.k=2022;t.s="Borland";}void main(void) { t.k=2021;t.s="Inprise";f(t);printf("%d,%s\n",t.k,t.s);}

设计一个共用体,顺序给共用体成员赋值,输出结果为____ ,____ ,____,____ 。#include union numb{ int a;char ch;float f; };int main(void){ union numb un1;un1.a=1;un1.ch='B';un1.f=10;printf("%.2f ",un1.f);un1.a=1;printf("%d ",un1.a);un1.ch='B';printf("%d %c",un1.a,un1.ch);}

答案查题题库