You need to place -
using Base::Display ; // in Derived class
If the method name matches the Derived class, the compiler will not look for the Base class. Therefore, to avoid this behavior, put using Base::Display; . The compiler will then study the Base class if there is any method that can actually accept an int as an argument to Display .
class Derived : public Base { public: using Base::Display ; void Display( void ) { cout<<"Derived display"<<endl; } };
Mahesh
source share