Struct variable doesn't changed by assignment
问题 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! Debug Result in XCode 回答1: The problem is, a signed 1 bit variable can hold only two values, -1