UINT_MAX + 1 equals what?

后端 未结 4 1993
执念已碎
执念已碎 2020-12-15 08:28

What is the defined behavior in C for UINT_MAX + 1u? How safe is to assume it is zero?

4条回答
  •  -上瘾入骨i
    2020-12-15 09:26

    It's safe. The C standard guarantees that unsigned integer overflow wrap-around results in zero.

提交回复
热议问题