Question: Consider the class A { public: virtual void isamA() { cout < < base ; } }; a. Derive two classes from class base,

Consider the class A { public: virtual void isamA() { cout < < "base "; } }; a. Derive two classes from class base, and for each define isamA() to write out the name of the class. b. Declare objects of each class, and call isamA() from them. c. Assign the address of objects of the derived classes to base pointers and call isamA() through the pointers. d. Remove the virtual keyword from the base class member function, run your code again, and compare the results.
Step by Step Solution
3.44 Rating (151 Votes )
There are 3 Steps involved in it
a Derive two classes from class base and for each define isamA to write out the name of the class cp... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
663e407894221_959099.pdf
180 KBs PDF File
663e407894221_959099.docx
120 KBs Word File
