写出以下程序的输出结果________。struct student{ int num; char name[10];int age;}void show(struct student *p){ printf("%s\n",(*p).name);}int main(){struct student stu[3]={{1001,”Li”,21},{1002,”Wang”,19},{1003,”Wu”,18}};show(stu+2);return 0;}
查看答案
写出以下程序的运行结果________。struct test{ int x;char c;};func(struct test b){ b.x=20; b.c='y';}int main(){ struct test a={10,'x'}; func(a); printf("%d,%c",a.x,a.c);return 0;}
写出下面程序段的输出结果________。struct stu{int x,*y;}*p;int d[4]={10,20,30,40};struct stua[4]={50,&d[0],60,&d[1],70,&d[2],80,&d[3]};p=a;printf("%d,",++p->x);printf("%d,",(++p)->x);printf("%d\n,",++(*p->y));
写出以下程序段的输出结果________。struct st{ int x,*y;}*p;int s[]={1,2,3,4};struct sta[]={1,&s[0],2,&s[1],3,&s[2],4,&s[3]};p=a;printf("%d\n",++(*(++p)->y));
写出以下程序段的输出结果________。struct tt{int x;struct tt *y;}*p;struct tta[4]={20,a+1,15,a+2,30,a+3,17,a};int i;p=a;for(i=1;i<=4;i++){printf("%-4d",p->x); p=p->y;}