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

Discussion

The type intended for the result of the sizeof operator is

  • A.int
  • B.uint32_t
  • C.ptrdiff_t
  • D.size_t

Answer: D

It is unsigned and wide enough for the largest object the implementation supports, which is why comparing it against a signed int provokes a warning. The pointer difference type is signed and serves a different purpose.

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

Post your comment

Please log in or register to post a comment.