Home » C Programming » Bit Fields » Question
  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. 75%
    2. 50%
    3. 33.3%
    4. 25%
    5. None of these
Correct Option: A

75%



Your comments will be displayed only after manual approval.