UINT_MAX + 1 equals what?

后端 未结 4 2014
执念已碎
执念已碎 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条回答
  •  鱼传尺愫
    2020-12-15 09:27

    Should be safe:

    Wiki on unsigned overflow

    Note the unsigned int overflow is well defined.

    Also, here's a whole question on this.

提交回复
热议问题