The Print() member function in your subclass hides the Print() member function of the superclass. Therefore, the compiler will not see A::Print() and will try to call B::Print() , complaining that int cannot be converted to a string.
To bring A::Print() to the overload set, you can enter a declaration using :
class A { public: void Print(int i) {cout<<i;} }; class B : public A { public: using A::Print;
Here is a live example of your code, working after necessary changes.
source share