accessing base class's method with derived class's object which has a method of same name.

Posted by ashish yadav on Stack Overflow See other posts from Stack Overflow or by ashish yadav
Published on 2010-03-13T07:07:07Z Indexed on 2010/03/13 7:15 UTC
Read the original article Hit count: 289

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about c++

Related posts about inheritance