ProgrammingHardTCS NQT · Infosys

int m[3][4]; What is sizeof(m) / sizeof(m[0][0])?

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

Correct answer: B. 12

sizeof(m) is 12 times sizeof(int), so the ratio is the element count 12 for any size of int. The 3 and 4 are the row and column counts, not the total.

More C Programming questions

Exams that ask this topic