accessing base class's method with derived class's object which has a method of same name.
- by ashish yadav
when accessing foo() of "base" using derived class's object.
include
class base
{
public:
void foo()
{
std::cout<<"\nHello from foo\n";
}
};
class derived : public base
{
public:
void foo(int k)
{
std::cout<<"\nHello from foo with value = "<
}
how to access base class method having a method of same name in derived class.
the error generated has been shown.
i apologize if i am not clear but i feel i have made myself clear as water.
thanks in advance.