#include #include #include #include #include class b { private: int num; int denom; public: b(); b(int,int); virtual void show() {cout << "b" << endl;} }; class d:public b { private: int neither; public: d(int,int,int); void show() {cout << "d" << neither << endl;} }; b::b(int x, int y):num(x),denom(y) {} d::d(int x,int y,int z):b(x,y),neither(z) {} // prints b // d4 int main(void) { d d1(5,6,7); d* d2 = new d(2,3,4); b b1=d1; b1.show(); b*b2=d2; b2->show(); return 0; }