CS202 Topic #3
42
Assignment Operators
•The 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.
•Another approach is to do the following….this works because s “is an” account object as well as a student object!
•  student &student::operator=(const student &s) {
•     account::operator=(s);