下程序的运行结果是:____,____,____。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);}
定义一个枚举类型,下面的程序段输出____。#include enum TLight{ green=1, red,yellow=0};int main(void){ enum TLight light;light=red;printf("%d ", light);light=yellow;printf("%d ", light);}