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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access