#include <stdio.h>
int main (int argc, char **argv)
{
union
{
int b4 ; /* 4byte */
unsigned short b2 [2] ; /* 2byte×2 */
unsigned char b1 [4] ; /* 1byte×4 */
} bytes ;
bytes.b4 = 0x12345678 ;
printf ("bytes.b4: %08X\n", bytes.
b4) ; printf ("bytes.b2: %04X, %04X\n", bytes.
b2[0], bytes.
b2[1]) ; printf ("bytes.b1: %02X, %02X, %02X, %02X\n", bytes.
b1[0], bytes.
b1[1], bytes.
b1[2], bytes.
b1[3]) ; return 0 ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiAKaW50IG1haW4gKGludCBhcmdjLCBjaGFyICoqYXJndikKICB7CiAgdW5pb24KICAgIHsKICAgIGludCBiNCA7ICAgICAgICAgICAgICAgIC8qIDRieXRlICAgICovCiAgICB1bnNpZ25lZCBzaG9ydCBiMiBbMl0gOyAvKiAyYnl0ZcOXMiAqLwogICAgdW5zaWduZWQgY2hhciBiMSBbNF0gOyAgLyogMWJ5dGXDlzQgKi8KICAgIH0gYnl0ZXMgOwogCiAgYnl0ZXMuYjQgPSAweDEyMzQ1Njc4IDsKICBwcmludGYgKCJieXRlcy5iNDogJTA4WFxuIiwgYnl0ZXMuYjQpIDsKICBwcmludGYgKCJieXRlcy5iMjogJTA0WCwgJTA0WFxuIiwgYnl0ZXMuYjJbMF0sIGJ5dGVzLmIyWzFdKSA7CiAgcHJpbnRmICgiYnl0ZXMuYjE6ICUwMlgsICUwMlgsICUwMlgsICUwMlhcbiIsIGJ5dGVzLmIxWzBdLCBieXRlcy5iMVsxXSwgYnl0ZXMuYjFbMl0sIGJ5dGVzLmIxWzNdKSA7CiAgcmV0dXJuIDAgOwogIH0K