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

Discussion

Reordering that structure's members largest first would reduce its size to

  • A.8
  • B.6
  • C.12
  • D.4

Answer: A

With b first, a and c then occupy two of the following bytes and two bytes of tail padding complete the four-byte multiple, giving eight. Declaring members in descending order of size is a cheap habit that saves memory in any structure instantiated many times.

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

Post your comment

Please log in or register to post a comment.