Machine-translated by Google. Questions are authored in English.
Top

Discussion

A record has fields of widths 4, 8 and 2 bytes laid out in that order with no padding. What offset does the third field occupy?

  • A.14
  • B.2
  • C.12
  • D.10

Answer: C

Correct answer: 12

With no padding the offsets are cumulative from zero: the first field at 0, the second at 4, and the third at \( 4 + 8 = 12 \). The offset is the running total of the widths before the field, which is why the third field’s own width of 2 does not enter the calculation.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.