// For exercise. // Class B inherits both overloads of the virtual functions vf. #include #include using namespace std; class A { private: double a; public: virtual void vf(double d){ // Virtual vf(double) cout << "virtual vf(double) in A: " << d << endl; } virtual void vf(){ // Virtual vf() cout << "virtual vf() in A" << endl; } }; class B : public A { private: double b; public: // B member functions here // B inherites vf(double) and vf() }; int main(){ B *b = new B(); b->vf(); // OK. A::vf() is called b->vf(5.0); // OK. A::vf(double) is called }