联合输出
[code#include<stdio.h>union book{
int leng;
double kk;
char a_name; };
int main()
{
union book x;
x.a_name='h';
x.kk=12.2;
x.leng=1;
printf("%c,%f,%d",x.a_name,x.kk,x.leng);
return 0;
}
][/code]这个a_name为什么显示不出来
#include"stdio.h" union book { int leng; double kk; char a_name; }; int main() { union book x; x.leng=100; x.kk=12.2; x.a_name='h'; printf("%d\n",x.leng); printf("%.2f\n",x.kk); printf("%c\n",x.a_name); return 0; }