#include<stdio.h>
int main()
{
struct value
{
int bit1:1;
int bit3:4;
int bit4:4;
}bit={1,8,15};
printf("%d%d%d",bit.bit1,bit.bit3,bit.bit4);
return 0;
}
The output is: -1-8-1
I know it is because of unsigned bit, but explain it more to me. Can't get why 8 prints -8 and why 15 prints -1.