Source: C ++ primer P1 ~ P49
Level: 100
STD: Endl
Note: The effect is not only a line break, but also a buffer refresh for immediate display of results.
In the debug process, the log should use the Endl to refresh the buffer for each sentence, so as to avoid the loss of the buffer information caused by crashes and cause debugging misleading.
Enter Ctrl + Z in the MS-DOS window to enter the file Terminator
Note: In some short small test programs, the while (STD: CIN> value) is often used to obtain the input. Pressing the carriage return will not cause the exit loop, press Ctrl + Z to achieve the goal.
True and false
Note: any non-0 value indicates true. The value 0 indicates false, and the value-1 indicates true.
L 'A' and l "ABC"
Note: You can add L before the character (string) to obtain the wide character (string) literal of the wchar_t type.
STD: cout <"AB" L "cd" <STD: Endl;
Note: the result of connecting string literal and wide string literal is undefined.
Int I (100); and INT I = 100;
Note: The above is direct initialization, and the following is replication initialization.
More flexible direct initialization (multiple parameters), more efficient (less than once ).
Built-in Automatic Initialization
Note: If the built-in type is defined outside the function, it is automatically initialized to 0. The definition in the function body is not automatically initialized.
Variable definitions in the function body should be manually initialized.
Automatic class initialization
Note: The default constructor is called no matter whether it is defined inside or outside the function.