ProgrammingHard

With int a[3][4] (4-byte int, row-major), what is the value of (int *)&a[1][0] - (int *)&a[0][0]?

  1. A. 3
  2. B. 4
  3. C. 12
  4. D. 16

Correct answer: B. 4

Subtracting two int pointers gives the number of ints between them, not bytes. Row 1 starts four ints after row 0.

More C Programming questions

Exams that ask this topic