Virtual Functions

  • + 2 comments

    Firstly make the getdata() function is virtual function after that taking input from user using cin object and name, age are the class instance variable of the same class.(this-> it is a reference of the same class instance member variables. )

    Another putdata() virtual function purpose is to print data those already stored in the class instance variables using cout abject form the output screen and endl is use to change the new line.

    I hope you are understood this explanation.