Hello all can someone help me with this piece of code
struct
{
unsigned BLOCKDATA:16;
unsigned QUALCOUNT:4;
unsigned BLOCKTYPE:2;
unsigned BE:1;
unsigned Z:1;
unsigned SYN:1;
unsigned DOK:1;
unsigned BM:1;
unsigned SYNDROME:5;
}
RDSout;
I understand that RDSout is a structure and BLOCKDATA and QUALCOUNT etc are the elements of this structure but I dont understand what the :16 in front of BLOCKDATA means?
This way you can declare how much bits you want reserved for that variable. It’s commonly used to align data structures. The wikipedia article contains a good explanation.