3Functions

C++ inherits all the C syntax, including the definition and usage of functions. In process-oriented programming (also known as structured programming), function is the basic unit of module division, and an abstract of the problem-solving process. Function is also important in object-oriented programming, in which it is an abstract of functionalities.

To develop or debug a complex system, engineers will usually divide it into several subsystems, and then develop or debug based on these subsystems. Subprograms in high-level program languages are used to realize this kind of module division. In C and C++, subprograms are embodied as functions. We usually abstract functions from independent and frequently used functionality modules. Once ...

Get C++ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.