typedef struct data
{
unsigned shor nWeekDay : 3 ;//(3 bits)
unsigned short nMonthDay : 6;// (6 bits)
.....
.....
}
内存中的排列:(理解为顺时针 旋转90度)
6 bits 3 bits
... .... .... nMonthDay nWeekDay
typedef struct
{
unsigned int warnmode: 4;//4 bits
unsigned int warnstrore: 2;// 2 bits
unsigned int reserved: 2;// 2bits
}warningbits_t (总的占用 4 字节 unsigned int )
typedef union
{
warningbits_t warningbits;// 4 bytes
BYTE warningbyte;// 1 byte
}warning_t (总的占用 4 字节 warningbits_t)
typedef struct
{
waring_t warningmessage; //4 bytes
uint16 duration;//2 bytes
}waringplay_t (6 bytes)
以最大的内存为基点,成倍申请内存,由偶地址对齐方式进行