C Programming MCQ

1:

Assuming that bit-fields are accomodated from right to left and word size is 16-bits

Consider the declaration
     static struct {
                              unsigned a : 5;
                              unsigned b : 5;
                              unsigned c : 5;
                              unsigned d : 5;
                           } v =  (1, 2, 3, 4); 

If the declaration unsigned c : 5; is replaced by unsigned : 6;
then,

A.

it results in a syntax error 

B.

it is meaningless

C.

the compiler will give a new name for the field, which can be used in the program

D.

none of the above

 

Answer : D

Explanation :

A bit-fiels need not be named

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.