P198. Program to understand bit field.

 

#include<stdio.h>

struct st

{

        unsigned int i:10;

};

void main()

{

        int c=0;

        struct st v;

        v.i=1;

 

        while(v.i)

        {

                v.i=v.i<<1;

                c++;

        }

        printf("Sizeof i : %d\n",c);

}

Comments