1, 16 mechanism and octal
A hexadecimal number corresponds to 4 bits, and the hexadecimal number starts with 0x. An octal corresponds to 3 bits, and the octal number begins with 0.
2. Original code and complement
The computer in memory is in the form of complement to store numeric value, positive complement is the original code itself, negative complement is its original code to take back plus 1, in addition, for the signed number, the highest bit 0 is positive, the highest bit 1 is negative.
3, bit arithmetic
Move left one bit, equal to the value of the original variable multiplied by 2, if the number of symbols left to move a symbol bit has changed to indicate that its value multiplied by 2 after overflow, is beyond the data type can be larger than the maximum value. Shift Right one represents divided by 2.
4. Initialization mode
int a=0 is generally used before; this type of initialization
There is also a more concise form of initialization:
int a (0);//use parentheses to initialize
5. Forced conversion
C-style cast, double a=2.9;
form one: int Xx=int (a);
Form two: int xx= (int) A;
C + + in the form of:
Type conversion operator < type descriptor > (expression)
int xx=static_cast<int> (a);
The type operation specifier can be:
Const_cast,dynamic_cast,reinterpret_cast,static_cast
6. C Style String
C + + Syntax