Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Unsigned int b = 65535printf("%d ",b); Why is the result-1?
Unsigned int b = 65535printf("%d ",b); Why is the result-1?
65535 is represented by an unsigned integer, and its binary number is11111165438+.

When converted into symbols,111111165438+.

We know that when there is a symbol, a negative number means that the original code is negated by 1. Then let's reverse1111165438.

First, because the maximum value is 1, it is11111. Then1111111116544. 38+01111111165438, and then Get 00000000000000001. So11111165438+.

So the output result is-1.

Please ask the master for advice.