typedef union {
unsigned short value;
unsigned char bytes[2];
}Test;
int main(void)
{
Test test_vaule;
test_vaule.value = 0x1234;
if (test_vaule.bytes[0] == 0x12 &&
test_vaule.bytes[1] == 0x34)
printf ("big ending\n");
else
printf ("small ending\n");
return 0;
}
阅读(473) | 评论(0) | 转发(0) |