Какая программа содержит ошибку?
(Отметьте один правильный вариант ответа.)
Варианты ответа
int main(void){ struct test { unsigned int : 3; unsigned int f1 : 1; unsigned int f2 : 1; unsigned int f3 : 1; unsigned int type : 8; unsigned int index : 18; }; int b; struct test t; t.f1 = 10; t.type = 3439; b = t.f1 + t.type; printf("b = %d\n", b); return 0;}
int main(void){ struct test { unsigned int : 3; unsigned int f1 : 1; unsigned int f2 : 1; unsigned int f3 : 1; unsigned int type : 8; unsigned int index : 18; }; int b; struct test t, *pt; pt = &t; pt->f1 = 11; t.type = 3439; b = t.f1 + t.type; printf("b = %d\n", b); return 0;}
int main(void){ struct test { unsigned int : 3; unsigned int f1 : 1; unsigned int f2 : 1; unsigned int f3 : 1; unsigned int type : 8; unsigned int index : 18; }; int a : 4, b; struct test t; t.type = 3439; b = a = t.type; return 0;} (Верный ответ)