Effective C ++ (Chapter 1 from C ++)

zhaozj2021-02-16  39

For everyone, habits C take some time, which is especially distressed for programmers that have been familiar with C. Because C is a subset of C , all C technology can continue to use, but many use is not suitable. For example, the C programmer will think of the pointer of the pointer looks quirky, they will ask: Why don't you replace the reference to the pointer? C is a simple language. It truly provides only macro, pointers, structures, arrays, and functions. No matter what problem, C is resolved by macro, pointer, structure, array, and functions. And C is not the case. Macros, pointers, structures, arrays, and functions, there are certainly, there are also private and protected members, function overload, default parameters, constructors, and destructor, custom operator, inline function, reference, friend, Template, exception, name space, etc. With C , it has a broader space with C because more choices can be considered when designing. In the face of so many options, many C programmers are in order to hold a regulations and insist on their old habits. In general, this is not a big sin. But some C habits are contrary to the spiritual nature of C , and they are elaborated in the following terms.