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

Discussion

In C, the value of ~0u is the largest value an unsigned int can hold.

  • A.True
  • B.False

Answer: A

Correct answer: True

The literal 0u is an unsigned int of value zero, and complementing it sets every bit, which is by definition UINT_MAX. This is a common portable idiom for obtaining an all-ones mask without naming the type’s width.

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

Post your comment

Please log in or register to post a comment.