I want to get the values of INT_MIN and INT_MAX. I\'ve tried ~0 and ~0 >> 1 since the leftmost bit is a sign bit bu
INT_MIN
INT_MAX
~0
~0 >> 1
On a 32bit system, 0 is 0x00000000. ~ is the bitwise not operator, which turns every 0 bit to 1 and vice versa. Therefore, ~0 (~0x00000000) gives 0xffffffff.
0
0x00000000
~
1
~0x00000000
0xffffffff
This in turn is interpreted as -1 in Two's complement.
-1