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 <

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

1 Expert Approved Answer
Step: 1 Unlock

a Derive two classes from class base and for each define isamA to write out the name of the class cp... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

663e407894221_959099.pdf

180 KBs PDF File

Word file Icon

663e407894221_959099.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!