Bit Fields


  1. Which of the following is not allowed?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    None of these


  1. In the following declaration of bit-fields, the constant-expression specifies __________.
    struct-declarator:
    declarator
    type-specifier declarator opt : constant-expression











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    The width of the field in bits



  1. In the following declaration of bit-fields, the constant-expression must be __________.
    struct-declarator:
    declarator
    type-specifier declarator opt : constant-expression











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Nonnegative integer value


  1. 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;











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    75%



  1. Bit fields can only be declared as part of a structure.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    true