Write const print and intersection member functions for a class that implements a mathematical set.
Let us examine an example program that calculates salaries and illustrates how static and const member functions use the this pointer.
Program dissection
Move your mouse cursor over the highlighted lines of code below for a pop-up discussion of their function.
The static keyword is used only in the class definition and needs to be omitted when the data or function member is defined outside the class.
Const Member Function - Exercise
Click the exercise link below to add const print and intersection member functions to a class that implements a mathematical set. Const Member Function - Exercise