Constructors.
Destructors.
friend functions.
Overloaded new operators.
Overloaded = operators.
What happens if we modify the Customer outputBalanceDue() as follows ...
void Customer::outputBalanceDue() const
{
cout << "ID :" << idNum << ", balance due $" << balanceDue << endl;
}
... so we directly output idNum, a base class data member? The private members of the base class cannot be directly accessed by the member functions of the derived class.
We could define a public Person function:
int getID() const { return idNum; }
class Person {
protected:
int idNum;
string firstName;
string lastName;
public:
void setFields(int, string, string);
void outputData();
};