ProgrammingModerate

struct Pair { int a; int b; }; struct Pair p = {.b = 4}; printf("%d %d", p.a, p.b); What is printed?

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

Correct answer: B. 0 4

The designator sets b to 4, and the unnamed member a is zero.

More C Programming questions

Exams that ask this topic