int main()
{
char* c;
struct bitfield {
int ia:3;
int ib:2;
int ic:3;
} field;
field.ia=4;
field.ib=2;
field.ic=2;
c=(char *) &field;
printf("%#x\n",*c);
return 0;
}
大端输出0xffffff92
小端输出0x54
小端:ia->ib->ic由低地址到高地址排序,即field内存映射为 010 10 100(0x54)
阅读(1719) | 评论(0) | 转发(0) |