ProgrammingVery hard

struct S { int key; int val; }; struct S arr[4] = {[2] = {7, 70}, {8, 80}}; printf("%d", arr[3].val); What is printed?

  1. A. 70
  2. B. 0
  3. C. 80
  4. D. 8

Correct answer: C. 80

The designator puts {7, 70} at index 2, and the next brace group goes to index 3, so arr[3].val is 80.

More C Programming questions

Exams that ask this topic