#include<stdio.h>
main()
{
struct value
{
int bit1 : 1;
int bit2 : 4;
int bit3 : 4;
}bit={1, 2, 2};
printf("%d %d %d\n",bit.bit1,bit.bit2,bit.bit3);
}
Output of this code is "-1 2 2" Please clarify the logic behind this output. Value of bit.bit2 and bit.bit3 is always same as the value assigned to it but bit.bit1 is changing with different integer values. why?