题目内容

以下程序的输出结果是( )。struct HAR{int x, y;struct HAR *p;} h[2];void main(){h[0].x=1;h[0].y=2;h[1].x=3;h[1].y=4;h[0].p = &h[1], h[1].p = h;printf("%d%d\n", (h[0].p)->x, (h[1].p)->y);}

A. 12
B. 23
C. 14
D. 32

查看答案
更多问题

有以下程序:#include struct stu{int num;char name[10];int age;};void fun(struct stu *p){printf("%s\n",(*p).name);}void main(){struct stu students[3]={{9801,"Zhang",20},{9802,"Wang",19},{9803,"Zhao",18}};fun(students+2);}输出结果是( )

A. Zhang
B. Zhao
C. Wang
D. 18

下面程序的输出是( )。typedef union{long x[2];int y[4];char z[8];} MYTYPE;MYTYPE them;void main(){printf("%d\n", sizeof(them));}

A. 32
B. 16
C. 8
D. 24

若有定义:struct KeyWord{char Key[20];int ID;}kw[] = { "void", 1, "char", 2, "int", 3, "float", 4, "double", 5 };则printf("%c,%d\n", kw[3].Key[0], kw[3].ID);语句的输出结果为( )

A. i 3
B. n 3
C. f 4
D. l 4

若有下面的说明和定义,则sizeof(struct aa)的值是( )。struct aa{int r1;double r2;float r3;union uu{char u1[5];long u2[2];} ua;} mya;

A. 30
B. 29
C. 24
D. 32

答案查题题库