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

Discussion

Which type has an alignment requirement at least as large as that of every other data type?

  • A.max_align_t
  • B.ptrdiff_t
  • C.size_t
  • D.NULL

Answer: D

Correct answer: max_align_t

max_align_t is an object type whose alignment requirement is at least as strict as that of every other scalar type. It matters to allocators: memory returned by malloc must be suitably aligned for any type, which is exactly this alignment. size_t and ptrdiff_t are integer types, and NULL is not a type at all.

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

Post your comment

Please log in or register to post a comment.