In C language, integer constants can be expressed in three ways: octal, decimal and hexadecimal.
Decimal expression is similar to regular expression, such as a =111; That means the value of a is111;
Octal integer constants are expressed by adding 0 before the number, that is, a = 011,which means octal11.
1 1 1 (8) = 1 * 8+ 1 * 8+ 1 = 73 ( 10)
Hexadecimal integer constants are expressed by adding 0x before the number, such as a = 0x11,which means hexadecimal11.
1 1 1 ( 16) = 1 * 16 * 1 * 16+ 1 ( 10)
~a is a negation operation, which is essentially a binary representation and then negates bit by bit (0 changes 1, 1 changes 0), but it is more troublesome to do so. The simple calculation method is to add 1 to the decimal value and then change it to a negative number.
For example,11(8) = 73 (10), then the value of ~a is -(73+ 1)=-74.