#include<stdio.h>
int main()
{
struct value{
int bit1 : 1;
int bit3 : 4;
int bit4 : 4;
}bit={1,2,2};
printf("%d %d %d\n",bit.bit1,bit.bit3,bit.bit4);
return 0;
}
Output :
-1 2 2
Please explain the oupput of the program ?
Presumably the only curious output is the first one.
Well, consider the range of values that a 1-bit two’s-complement integer can represent.