填空题

下面程序的运行结果是______。 #include<stdio.h> main() { union { int i[2]; long k; char c[4]; }t,*s=&t; s->i[0]=0x12; s->i[1]=0x34; print f("%1x\n",s->k); }

【参考答案】

340012
<上一题 目录 下一题>
热门 试题

单项选择题
已知学生记录描述为 struct student { int no; char name[20]; char sex; struct { int year; int month; int day; } birth; }; struct student s;变量s中的“生日”应是“1985年4月4日”,下列对“生日”的正确赋值方式是______。
A.year=1985;month=4;day=4;
B.birtyear=1985;birtmonth=4;birtday=4;
C.year=1985;month=4;day=4;
D.birtyear=1985;birtmonth=4;birth,day=4;
单项选择题
有以下说明和定义语句 struct student {int age;char num[8]; }; struct student stu[3]={{20, 200401 },{21, 200402 },{10 9, 200403 }}; struct student*p=stu;以下选项中引用结构体变量成员的表达式错误的是______。
A.(p++)->num
B.p->num
C.*num
D.stu[0].age
相关试题
  • 用typedef定义整型一维数组:typedef char...
  • 以下程序的运行结果是______。# in...
  • 有以下程序 struct stu { char num[...
  • 以下程序运行后的输出结果是______。...