Functions in Your Editor and Add Following Code
Functions in Your Editor and Add Following Code
/////////////////////////////////////////////////////////////////////////////////////
From the abstract classess lecture, write the person program to demonstrate pure virtual
functions in your editor and add following code
int main()
person p1;
p1.getname();
/////////////////////////////////////////////////////////////////////////
int main()
stu.getdata();
stu.putname();
In the line class student : public person change public to private and run the program.
In the line class student : public person change public to protected and run the program.
In function getdata of class student, change person::getname() to person.getname(). Run to see output
(REMINDER :: is the scope resolution operator which is used when function is defined in one class and
we want to use it in another class. (. operator) is used to access method or variables of an object)
/////////////////////////////////////////////////////////////////////////////////////////////////////////