Member Functions vs. Global Functions (Also Called Free Functions)

The printUniversal and printStandard member functions take no arguments, because these member functions implicitly know that they’re to print the data members of the particular Time object on which they’re invoked. This can make member function calls more concise than conventional function calls in procedural programming.

Image Software Engineering Observation 9.3

Using an object-oriented programming approach often simplifies function calls by reducing the number of parameters. This benefit derives from the fact that encapsulating data members and member functions within a class gives ...

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.