注意是从
低位到高位的
struct stTest
{
union
{
struct
{
unsigned char byOne;
unsigned char byTwo;
};
unsigned int feature;
};
};
int _tmain(int argc, _TCHAR* argv[])
{
stTest test;
test.feature = 1;
printf("%d %d\n", test.byOne, test.byTwo); // 1 0
return 0;
}
posted on 2007-07-09 21:17
七星重剑 阅读(2972)
评论(2) 编辑 收藏 引用 所属分类:
PL--c/c++