注意是從
低位到高位的
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
七星重劍 閱讀(2985)
評論(2) 編輯 收藏 引用 所屬分類:
PL--c/c++