int integral type in Visual C + + is typically represented by four bytes
to store an int in a computer in the form of a complement (for a positive number whose complement is equal to the original code),
Complement of numbers from 0000 0000 0000 0000 0000 0000 0000 0000~1111 1111 1111 1111 1111 1111 1111 1111
The conversion rules of the complement and the original code, 1111 1111 1111 1111 1111 1111 1111 1111 indicates a value of-1;
1111 1111 1111 1111 1111 1111 1111 1110 indicates a value of-2;
1111 1111 1111 1111 1111 1111 1111 1101 Indicates a value of-3;
:
:
1000 0000 0000 0000 0000 0000 0000 0001 Indicates a value of-2147483647;
the 1000 0000 0000 0000 0000 0000 0000 0000 is rigidly defined as-2147483648;
Simplification of the understanding:
For a 8-byte integer (int), the range is 2 of the 8-square, representing -128~127. As shown in the table below, if you use the original code and the inverse code,
+0 and 0 are the same number but there are two different representations, which will not only make the computer more layer processing, but also waste a representation range, and the complement can be a good solution to the problem.
(-128 has only the complement, not the original code and the inverse code, because the value bit can only represent 0~127. )
The range represented by int in Visual C + +