0

Why we can not call this function Base::P(int)?

class Base
{   
protected:
    string s = "Base";
public:
    void P(int a){ cout << "Base" << endl; }
};
class Derived : public Base

public:
    using Base::s;  
    void P(){ cout << "Derived" << endl; }
};

int main()
{
    Derived a;
    a.P(2);   // Error, Why we can not use Base::P(int)?
}

Why we can not use Base::P(int)?

Person.Junkie
  • 1,816
  • 4
  • 21
  • 31

0 Answers0