ProgrammingHard

char g[3][4] = {"abc", "de", "f"}; What is the value of g[1][2] when printed with %d?

  1. A. 101
  2. B. 0
  3. C. 32
  4. D. -1

Correct answer: B. 0

"de" fills g[1][0] and g[1][1] and the terminator takes g[1][2]. The rest of the row is zero-filled, so the printed value is 0.

More C Programming questions

Exams that ask this topic