题目内容

有以下程序#includestruct ord{ int xpos,ypos;}dt[2] = {1,2,3,4};int main(){ struct ord *p = dt; printf("%d,",++(p->xpos) ); printf("%d\n", ++(p->ypos) );}程序运行后的输出结果是______

查看答案
更多问题

有以下程序:#includestruct stud{ int num; char sex;};void func( struct stud b){ b.num = 1002; b.sex = 'f';}int main(){ struct stud s = {1001,'m'}; func(s); printf("%d,%c\n",s.num ,s.sex);}该程序的运行结果是:______

已知:struct { float a,b,c;}ex;则sizeof(ex)的值是( )。

A. 4
B. 6
C. 8
D. 12

设有定义:struct{ char mark[12]; int num1; double num2;}t1, t2;,若变量均已正确赋初值,则以下语句中错误的是( )。

A. t1 = t2;
B. t2.num1 = t1.num;
C. t2.mark = t1.mark;
D. t2.num2 = t1.num2;

以下对结构体变量stu1中成员num的非法引用是( )。struct student{ int num; char sex;}stu1, *p;

A. stu1.num
B. student. num
C. p->num
D. (*p). num

答案查题题库