Data Encapsulation

In C++, as in other languages, the programmers hide the complexity of computer algorithms in functions. Each function is a collection of statements directed toward achieving a specific goal. The name of the function usually reflects this goal. It is common to compose the function name using two components, an active verb that describes the action and the noun that describes the object (or is it the subject?) of the action, for example, processTransaction(), acceptInput(), and so on. When the object of the action is clear from the context (e.g., when it is passed to the function as a parameter), only a verb can be used, for example, add(), delete(), and so on.

The collection of statements in the function can contain simple ...

Get Core C++ A Software Engineering Approach 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.