Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - I want to ask a question about C++ literal. This book says that although plastic characters can be stored in signed data types, strictly speaking, decimal characters.
I want to ask a question about C++ literal. This book says that although plastic characters can be stored in signed data types, strictly speaking, decimal characters.
I don't know what you mean, data is stored in binary. Positive integers are stored in his binary system, and negative numbers are stored in his two's complement system, that is to say, his highest bit (leftmost) is 1 and the integer is 0. Generally, whether it is negative is judged by whether the first digit is 0.

The binary of-42,42 is 000000000000001010.

So -42 is1111111/kloc-0. 1111101010 (Supplements)

For an unsigned integer with a negative number, the compiler will convert it into this number and get the number of numbers that the type of this number can take.

For example, if-1 is assigned to an 8-bit unsigned character, the result is 255, because 255 is the modulus value of-1 to 256 (-1 mod 255=256).