In C language, why does the signed short integer output in 16 show 8 bits and the unsigned short integer output shows 4 bits? But the number of bytes is the same.
The two-byte complement of -7 is111111165438. Then "sign bit expansion" must be performed to 4 bytes before output. Since the "sign bit" of unsigned type is considered as 0, C is extended to 000000000000111111/60. Leading zeros are eliminated by default when outputting, so the final output is FFF9-or it can be simply understood as "unsigned types do not carry out' sign bit extension' (because there is no sign)". Before output, A is expanded to111111165438. 1111111001,so the output is FFFFFFF9. put on file ...