However, because characters and integers are compatible, char characters can also be output in %d, although the output result is not what we want. ...
Because all symbols are stored in ASCII codes corresponding to 0~255, c= 130 should be converted into binary, that is, the state of c= 130 in memory.
The binary string converted from 130 is "1000".
00 10 ",but the data in the computer is stored in the complement, so this" 1000 ".
00 10 "is the complement, so the complement is 1000.
What is the number of 00 10?
- 126!
So the key to output-126 is to use% d.
"%d", when output, because "1000.
00 10 "is 8 digits, which should obviously be very short.
Int, so the compiler automatically interprets it as "hd" (note that the highest bit is 1), so it is interpreted as-126.