下面程序的运行结果为:struct tag{ char low;char high; };union word{struct tag byte;short word; }w;main( ){ w.word=0x6b7d;printf("word value:%x\n",w.word);printf("low value:%x\n",w.byte.low);printf("high value:%x\n",w.byte.high);w.byte.high=0x56;printf("word value:%x\n",w.word);}
查看答案
下面程序的运行结果为:#include union p{int i;char c[2];}x;main(){x.c[0]=13;x.c[1]=0;printf("%d\n",x.i);}
下面程序的运行结果为:main(){ union{long i;int k;unsigned char s;}abc;abc.i=0x12345678;printf("%x\n",abc.k);printf("%x\n",abc.s);}
下面程序的运行结果为:main( ){union bt{int k;char c[2];}a;a.k=-7;printf("%o,%o",a.c[0],a.c[1]);}
已知字符0的ASCII码为十六进制的30,下面程序的输出是___________。main(){ union {unsigned char c;unsignedint i[4];} z;z.i[0]=0x39;z.i[1]=0x36;printf("%c\n",z.c);}