Write input member functions for the student and grad_student classes that read input data for each data member of the respective classes.
The print() member function is implemented in both the student and grad_student classes as follows:
For grad_student::print() to invoke the student::print() function, the scope resolved identifier student::print() must be used. Otherwise, there will be an infinite loop. To see which versions of these functions get called, and to demonstrate some of the conversion relationships between base and publicly derived classes, we write a simple test program:
C++ Test pointer components
The diagram below details the elements of the C++ Test Pointer.
Click the Exercise link below to write input member functions for the student and grad_student classes that read input data for each data member of the respective classes. Input Member Function - Exercise