Possible Duplicate:
What does 'unsigned temp:3' means
A struct‘s definition goes like this,
typedef struct
{
uint32_t length : 8;
uint32_t offset : 24;
uint32_t type : 8;
} A;
I haven’t seen this kind of definition before, what does it mean by :8 and :24?
It’s defining bitfields. This tells the compiler that
lengthis 8 bits,offsetis 24 bits andtypeis also 8 bits.