struct st
{
int a1 : 3;
int a2 : 2;
int a3 : 1;
}
void main(void)
{
x.a3 = -1;
if (x.a3 == -1) printf("TRUE\n");
else printf("FALSE\n");
x.a3 = 1;
if (x.a3 == 1) printf("TRUE\n");
else printf("FALSE\n");
}
In case, 'x.a3 = -1;' First if is TRUE.
But, why 'x.a3 = 1' doesn't changed in second if ? It's still x.a3 = -1.
And
If I type 'x.a3 = 1;' in first if, it still x.a3 = = 1 !! It doesn't changed!