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

Discussion

The width of a record type is computed during declaration processing by

  • A.summing the widths of its fields with any alignment padding
  • B.taking the width of the largest field in the record
  • C.counting up the number of fields and then multiplying that by four
  • D.asking the target machine at run time for the value

Answer: A

Correct answer: summing the widths of its fields with any alignment padding

The width is the total the fields occupy, including any padding inserted so that each field begins at an address its type requires. That padding is why a record can be wider than the sum of its fields, and why reordering fields can change the size of a structure without changing its contents.

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

Post your comment

Please log in or register to post a comment.