C language signed and unsigned:
In C language, all operands are automatically convertedUnsigned type
Signed int A =-110; unsigned int B = 2; cout <a + B <Endl;
For floating point numbers, float (double) is actually a signed number. The unsigned and signed prefixes cannot be added to float and double, of course, there is no conversion problem between the unsigned numbers.
The main difference between signed and unsigned integers is how to view the highest bit:
For a single-byte binary number of 01010110, the unsigned integer is 86, and the number of symbols is also 86, because the highest bit is 0, there is no difference between the two.
For binary 10101100, the unsigned number is 172, and the signed number is-84. The two are very different.
Unsigned char a =-1; cout <(unsigned);
The above output 255 should be like this:-1 is signed, it should be 11111111, and then assign this value to A. When the output is unsigned A, it is interpreted as 255.
C. Review