0
Quick Help needed on C
I saw a struct declaration in form of struct name { uint8_t type:4; uint8_t length:6; } My question is, why insert a colon between the field name and the literal value? In particular, what's the use of doing 'type:4'? https://code.sololearn.com/cvqIJ14p1OBu/?ref=app
1 Answer
+ 7
It's called bit field,
https://en.cppreference.com/w/cpp/language/bit_field