1. Data type
1) Basic data type: Int,char,float,double,bool
Eg:int a=1; Defines an int type object (variable) and initializes it to 1
2) Extended base data type: vector (vector), list, string (string), complex number (plural)
Eg: #include <vector> must have a header file
#include <string> must have a header file
Vector<string> Chapter_titles (20); Defines a vector object with 20 elements of a string type
2. Preprocessor Indicator
1) #include
1) shaped like <iosteam>: standard header file, search by default directory
2) shaped like "myfile.h": User-defined file, search under current directory
2) Condition Indicator: Prevents repeated processing when a header file is referenced by multiple files
Eg: #ifndef bookstore_h if not defined Bookstore.h
#define BOOKSTORE_H , then define Bookstore.h .
/* Contents of the Bookstore.h */ header file
End of #endif definition
PS: #ifndef =if not define #ifdef =if define Bookstore_h is a preprocessor constant of bookstore.h
3) Common Processor text
1) _cplusplus: According to it to determine whether the program is a C + + program
2) _stdc_: According to it to determine whether the program is a C + + program
3) _line_: The number of rows currently compiled to
4) _file_: The currently compiled file name
5) _time_: The current compile time
6) _date_: Date of the current compilation
7) Aseert (): Pre-processing macros. Execution continues when the preconditions in parentheses are met, otherwise an error message is displayed and terminated.
(C:assert.h C++:cassert)
This article is from the "Momo echnical honor" blog, please be sure to keep this source http://momo462.blog.51cto.com/10138434/1738058
C++primer Note--chapter One