ProgrammingHard

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

  1. A. 7
  2. B. 8
  3. C. 2
  4. D. 0

Correct answer: D. 0

Index 1 is not initialised by any designator or brace group, so it is zero.

More C Programming questions

Exams that ask this topic