Question: Which version of the print function would be invoked by the code: Person* x = new Student; x->print (); class Person { ... };

 Which version of the print function would be invoked by the code:  

Which version of the print function would be invoked by the code: Person* x = new Student; x->print (); class Person { ... }; public: void print () const; class Student public Person { ... }; public: void print () const;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

In C when a base class pointer points to a derived class object and a ... 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

Students Have Also Explored These Related Programming Questions!