C ++ Primer Reading Notes (1) Article 1: C ++ overview, Chapter 1: Start, primer Reading Notes
1. Main Content
This article introduces the core idea of programming language and basic concepts of C ++.
What impressed me a lot isDivide and conque)Decomposition idea.
2. Knowledge Square
1) C ++ file suffix
2) compiler Functions
- 1. Check errors (syntax errors and type errors );
- Ii. Code Generation (Generating target code or assembly instructions)
3) implicit conversion of built-in types
4) # The include indicator reads the content of the specified file.
- <> Indicates a project or standard header file. Search for environment variables.
- "" Indicates that the user provides the header file. Search from the current directory.
- The introduction of nested header files promotes # ifndef to avoid repeated introduction of header files.
- C ++ name of the C library header file: cassert [the definition of C ++ name needs to be introduced by using namespace std], and the C Name Is assert. h.
5) define Preprocessor Constants
-D name
_ Cplusplus: c ++ file, __stdc __: c file
_ TIME __: TIME ,__ DATE __: DATE;
_ FILE __: Number of compiled lines. [Changeable]
6) input and output streams
Standard iostream: cin, cout, and cerr are pre-defined iostream objects. The endl is an iostream operator, indicating an operation. In addition to providing line breaks, the output buffer is refreshed.
File fstream: ifstream, ofstream object.