int max = ~0; What does it mean?

前端 未结 8 2054
灰色年华
灰色年华 2021-01-19 03:46

int max = ~0;

What does it mean?

8条回答
  •  孤独总比滥情好
    2021-01-19 04:34

    As noted, ~0 yields 0xFFFFFFFF.

    However, I suspect the original programmer is confused. executing int max = ~0 ; sets the signed integer max to the value -1.

提交回复
热议问题