ProgrammingVery hard

struct E { int n; int a[]; }; printf("%zu", sizeof(struct E)); What is printed for a struct with a flexible array member and 4-byte int?

  1. A. 4
  2. B. 0
  3. C. 8
  4. D. 1

Correct answer: A. 4

The flexible array member adds no size to sizeof. Only n is counted, so the size is 4.

More C Programming questions

Exams that ask this topic