#define MSB 0
#define LSB 1
typedef unsigned char u08;
typedef unsigned int u16;
typedef signed char s08;
typedef signed int s16;
typedef union{
u16 u16;
s16 s16;
u08 u8[2];
s08 s8[2];
}uu16;
void Test(void)
{
uu16 uusTmp;
uusTmp.u8[MSB] = 0x03;
uusTmp.u8[LSB] = 0x12;
if (uusTmp.u16 != 0x0312)
{
//error
}
}
|