Bit Fields
- Which of the following is not allowed?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
None of these
- In the following declaration of bit-fields, the constant-expression specifies __________.
struct-declarator:
declarator
type-specifier declarator opt : constant-expression
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The width of the field in bits
- In the following declaration of bit-fields, the constant-expression must be __________.
struct-declarator:
declarator
type-specifier declarator opt : constant-expression
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Nonnegative integer value
- Calculate the % of memory saved when bit-fields are used for the following C structure as compared to with-out use of bit-fields for the same structure? (Assuming size of int = 4)
struct test
{
int p : 1;
int q : 2;
int r : 4;
int s : 4;
}stu;
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
75%
- Bit fields can only be declared as part of a structure.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
true