ProgrammingHard

struct S { int a; char c; } arr[2] = {{1}}; printf("%d", arr[1].a); What is printed?

  1. A. 1
  2. B. garbage
  3. C. 0
  4. D. 2

Correct answer: C. 0

Members left out of an aggregate initialiser are zero, so arr[1].a is 0.

More C Programming questions

Exams that ask this topic