Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Integer variable int i=32767, why output ++i-32768?
Integer variable int i=32767, why output ++i-32768?
Because your value overflows, the maximum value of int is 32767. If you add one now, it will go beyond the range that int can represent, so -32768 will appear.

In memory, it means 0111111165438.

One more is/kloc-0 10000000000000000.

The signed number represented is -32768.

If represented by an unsigned number, it is 32768.