Complete the code to declare a bit field of 3 bits named 'flag'.
struct Status {
unsigned int flag : [1];
};The bit field size is specified after the colon. Here, 'flag' is 3 bits wide.
Complete the code to declare a bit field named 'mode' with 2 bits inside the struct.
struct Control {
unsigned int [1] : 2;
};The field name is 'mode' and it has 2 bits allocated.
Fix the error in the bit field declaration to make it valid C code.
struct Flags {
unsigned int error [1] 1;
};The colon ':' is required between the field name and the bit width in a bit field declaration.
Fill both blanks to declare a struct with two bit fields: 'ready' (1 bit) and 'error' (2 bits).
struct Status {
unsigned int [1] : 1;
unsigned int [2] : 2;
};The first field is 'ready' with 1 bit, the second is 'error' with 2 bits.
Fill all three blanks to create a bit field struct with fields: 'mode' (3 bits), 'status' (4 bits), and 'flag' (1 bit).
struct Device {
unsigned int [1] : 3;
unsigned int [2] : 4;
unsigned int [3] : 1;
};The fields are declared in order: 'mode' with 3 bits, 'status' with 4 bits, and 'flag' with 1 bit.