C++: a language federation

C++ consists of four parts: C language, object-oriented, templates (generic programming), STL (template library)

 

Therefore, the C++ program has the characteristics of the above four parts.

When the C language part of C++ is used, function parameter transfer is divided into, value transfer, reference transfer

When using the C++ object-oriented part, the method of passing function parameters is recommended to be passed by constant reference.

 

C language: blocks, statements, preprocessor, built-in types, arrays, pointers, no templates, no exception handling, no overloading

Object Orientation: Classes, Encapsulation, Inheritance, Polymorphism, Dynamic Binding, …

Templates: generic programming, programming paradigms, template metaprogramming (TMP) (template metaprogramming can compute results during compilation: e.g. compute the factorial of a number, which is used as a constant at runtime)

STL: Template Libraries, Containers, Iterators, Algorithms, Function Objects


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325562984&siteId=291194637