Not all member functions need be made public to serve as part of the interface of the class.
- Access functions
- public
- Read/display data
- Predicate functions
- Check conditions
- Utility functions (helper functions)
- private
- Support operation of public member functions
- Not intended for direct client use
The program of Figs. 1.13-1.16 demonstarates the notion of a utility function (also called helper function).
Figure 1.14:
SalesPerson class member-function definitions (part 1 of 2)
|
Figure 1.15:
SalesPerson class member-function definitions (part 2 of 2)
|
Figure 1.16:
Utility function demonstration
|
2004-07-29