Effective C++ (1)

Start taking reading notes from today.1. Get accustomed to C++item1:C++ is a language federation.C++ is a multiparadigm programming language that supports procedural, object-oriented, functional, generic, and metaprogramming styles.—11The main sub-languages are: C, Object-Oriented C++, Template C++, STL.—12item2:Try to replace #define with const, enum, and inline, using the compiler instead of the preprocessor.const char * const authorName = “Scott Meyers”;—-14The first const modifies *, indicating that the pointer’s value does not change, while the second const modifies authorName, indicating that the pointer itself does not change.enum { NumTurns = 5 };int scores[NumTurns];—15Use enum to replace macro definitions for array sizes and other constant values.

Leave a Comment