ProgrammingVery hard

int r = 2, c = 5; int m[r][c]; printf("%zu", sizeof m); What is printed on a platform with 4-byte int (C99 variable-length array)?

  1. A. 20
  2. B. 10
  3. C. 40
  4. D. 24

Correct answer: C. 40

The VLA has 2 x 5 = 10 ints, which is 40 bytes. sizeof is evaluated at run time here.

More C Programming questions

Exams that ask this topic