ProgrammingHard

int a[3][4]; int *p = &a[0][0]; Which expression refers to a[2][1]?

  1. A. p[8]
  2. B. p[9]
  3. C. p[10]
  4. D. p[7]

Correct answer: B. p[9]

a[2][1] is at flat index 2 * 4 + 1 = 9 from the start of the array.

More C Programming questions

Exams that ask this topic