这种用法是称为字节数组吗
这是一段用来测试大小端的代码:
程序代码:#include <stdio.h>
int main(void)
{
short int x;
char x1,x2;
x = 0x1122;
x1 = ((char *)&x)[0]; //低地址
x2 = ((char *)&x)[1]; //高地址
printf("x1=0x%x\n",x1);
printf("x2=0x%x\n",x2);
return 0;
}其中: x1 = ((char *)&x)[0];
x2 = ((char *)&x)[1];
为什么可以这样来用?这是字节数组吗?








