LXR / The Linux Cross Reference
integer declaration
unsigned int is_added:1;I have made C programs and declared integers in them but in the above I see use of
:
What sort of syntax is that?
unsigned int is_added:1;I have made C programs and declared integers in them but in the above I see use of
|
|
|
struct B
{
unsigned a: 4; // 4 bits
unsigned b: 1; // +1 bit, same group, (4+1 is rounded to 8 bits as next data member is normal variable definition)
unsigned char c; // +8 bits
unsigned d: 7; // + 7 bits
};
// sizeof(B) = 3 (4+1 rounded to 8 + 8 + 7 = 23, rounded to 24)
0 members, 1 guests, 0 anonymous users