写出以下程序段的输出结果________。struct str1{ char c[5];char *s;};struct str1 s1[2]={{"ABCD","EFGH"},{"IJK","LMN"} };struct str2{struct str1 sr;int d;}s2={"OPQ","RST",32767};struct str1 *p[2];p[0]=&s1[0];p[1]=&s1[1];printf("%s",++p[1]->s);printf("%c",s2.sr.c[2]);
查看答案
写出以下程序的输出结果________。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));