标签:
在32位小端的机器上,如下代码输出是什么:
1 char array[12] = {0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08}; 2 short *pshort = (short *)array; 3 int *pint = (int *)array; 4 int64 *pint64 = (int64 *)array; 5 printf("0x%x , 0x%x , 0x%x , 0x%x", *pshort , *(pshort+2) , *pint64 , *(pint+2));
答案:
0x201 , 0x605 , 0x807060504030201 , 0x0
标签:
原文地址:http://www.cnblogs.com/WonderHow/p/4442806.html