我是新來的工作與位。我試圖使用現有的協議,它可以發送三種不同類型的消息。 類型1是一個16位結構: struct digital
{
unsigned int type:2;
unsigned int highlow:1;
unsigned int sig1:5;
unsigned int :1;
unsigned int sig2:7;
};
的前兩個比特(型,在上述我的結構)
閱讀我有這樣的typedef: typedef union
{
unsigned Value;
unsigned Timestamp:16;
} BITFIELD;
,並得到這個編譯器警告: BITFIELD bitfield;
// read from uninitialised memory - may result in unexpected behaviou