Possible Duplicate:
C++: rationale behind hiding rule
Suppose I have a code:
class A
{
public:
void f(int s) {}
};
class B:public A
{
public:
void f() {}
};
int main()
{ B ob;
ob.f(4);
}
Then in this case compiler generates an error that "no matching function for call to ‘B::f(int)'" But class B has inherited A as public so B must have the function "void f(int s)". Dont know why compiler is generating error here?