



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




class Shape { public: virtual void draw() const = 0; virtual void error(const string &msg); … .. } class Rectangle: public Shape { …. };
D x; // x is an object of type D B *pB = &x; // pB is pointer to x pB->mf(); // call mf through pointer D *pD = &x; // pD is pointer to x pD->mf(); // call mf through pointer