nFor the assignment operator, this is not as simple. We must invoke the base class' assignment operator from within the body of our derived class' assignment
op.
nTo do so requires that we
cast the current object (accessible
by *this) into a base class object as follows:
n student
&student::operator=(const student &s) {
n ... static_cast<checking &>(*this)
= s;
nThe static_cast operator forces the type of the student object to be a reference to a checking object. It causes
the overloaded checking assignment
op. to be used for the object
we are assigning to. When we assign the student object to this reference, the overloaded checking assignment operator is called with the checking part of the student object.