请教大家个问题.关于位赋值的问题,谢谢了
typedef struct Data_s
{
unsigned int ulData1:2;
unsigned int ulData2:12;
unsigned int :2;
}Data_s;
int main()
{
Data_s stData;
unsigned int *pData;
memset((void*)&stData,0,sizeof(Data_s));
stData.ulData1=0x7;
stData.ulData2=0x010;
pData=(unsigned int *)&stData;
printf("0x%x\n",*pData);
}
输出结果是0X43,可是我怎么也得不到,请问什么原因啊。
还有 unsigned int :2 是什么意思啊?;