Now we can use the frameworks of variables, functions, and classes to construct a largeProgramBecause we are standing on the shoulders of giants.
I. Type : Tell the compiler how many bits are required, how to explain these bits, and which operation sets can be applied to the variable. Basic built-in internal type: INTEGER: integer character CHAR: 256 basic character wchar_t: Extended character set, such as Japanese and Chinese Boolean floating point type:
Literal Value constant: It can only be called by value, and its value cannot be modified. The literal value constant also has a type.
| Left value: it can appear on the left or right of the value assignment statement. The variable is the left value. |
| Right Value: it can only appear on the left of the value assignment statement. The literal value is the right value. |
Variable:
2. A library is a collection of classes. A library contains many standard classes, such as istream and iostream. CIN is the object of istream, cout, cerr, clog is the object of ostream, cout, clog are buffered, cerr is not buffered, read CIN will refresh the buffer. Note: istream and buffer are not a concept. The operating system operates on the buffer zone independently of the program. That is to say, we users do not know when the buffer will be refreshed to the output device, however, we can use the manipulator Endl to forcibly refresh the buffer. "Stream" indicates that characters are dynamically generated or consumed in chronological order.
3. Expression = operand + operator.
The smallest unit of computing. Each expression returns a result, for example, cout <'A'. The returned result is the output stream itself, therefore, cout <'A' <'B' can be used for writing.
4. Incorrect comments are worse than no comments, because they may mislead others. 5. The main task of the compiler is to find programs. Code Error Syntax Error Type Error declaration Error 6. When using a class, pay attention to three issues: Where to define the class and what operations are supported? 7. member functions are part of the object, because it will operate on a specific object