若有定义:struct num{int a;int b;float f;}n={1,3,5.0};struct num *pn=&n;则表达式pn->b/n.a*++pn->b的值是①,表达式(*pn).a+pn->f的值是②。
查看答案
设有说明struct DATE{int year;int month; int day;};请写出一条定义语句,该语句定义d为上述结构体变量,并同时为其成员year、month、day 依次赋初值2010、10、1。语句为:①
#includestruct st{int x, y;} data[2] = {1,10,2,20};void main(){struct st *p = data;printf("%d,", p->y);printf("%d\n", (++p)->x);}阅读程序,分析程序的运行结果为:
阅读下列程序,分析程序的运行结果。#includestruct STU{char name[9], sex; double score[2];};void main(){struct STU a = {"zhao",’m’,85.0,90.0}, b = {"Qian",’f’,95.0,92.0};b = a;printf("%s,%c,%2.0f,%2.0f\n", b.name, b.sex, b.score[0], b.score[1]);}运行结果为:
阅读下列程序,分析程序的运行结果。#includestruct ord{int x, y;} dt[3] = {1,3,5,7,9,11};void main(){struct ord *p = dt;printf("%d,", ++p->x);printf("%d", ++p->y);}运行结果为: