ProgrammingModerate

Assume natural alignment with 4-byte int. What is sizeof(struct R[5]) where struct R is the eight-byte type from the previous record?

  1. A. 32
  2. B. 48
  3. C. 40
  4. D. 35

Correct answer: C. 40

An array of structs is laid out contiguously with no extra padding between elements, so five copies of an 8-byte struct take 40 bytes.

More C Programming questions

Exams that ask this topic