Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language: Why output 65535?
C language: Why output 65535?
Because you define A as an unsigned short integer, the complement of-1 is111111. Moreover, because A is an unsigned short integer and cannot store negative numbers, the highest order at this time is not a negative sign, but a numerical value, so it becomes 65535. If a is defined as an int type, it will output-1. Note that you should avoid assigning negative numbers to unsigned types during assignment.