Question: I was going through this [Book](http://publib.boulder.ibm.com/infocenter/lnxpcomp/v101v121/index.jsp?topic=/com.ibm.xlcpp101.linux.doc/language_ref/cplr139.html) and I can't wrap my head around this:

if `B::f(int)` hides `A::f()`, why does `pa1->f();` not give an error?

Doesn't name hiding mean that, the function `f()` doesn't exist in `class B`? And if `pa1` points to an object of `class B` then `pa1->f();` should result in an error just as `b.f()` does!

Please explain this, as I can't understand it through the book! 
Thanks in advance!

```
#include <iostream>
using namespace std;

struct A {
   virtual void f() { cout << "Class A" << endl; }
};

struct B: A {
   void f(int) { cout << "Class B" << endl; }
};

struct C: B {
   void f() { cout << "Class C" << endl; }
};

int main() {
   B b; C c;
   A* pa1 = &b;
   A* pa2 = &c;
//   b.f();
   pa1->f();
   pa2->f();
}

```

Answer: 
It would be an error if you tried to call `f()` from scope of `B`. But, you're calling it through a pointer to base class. The name lookup and overload resolution is done based on the static type of the object, `A*` in this case. From there, `f()` is visible.
The call pa1->f(); is first routed to object of type A, since pa1 is a pointer to that type. The virtual keyword would re-route the call to type B if there was a function that matches the exact(!!) signature of the call. Since there is no such function in type B, the type A function is executed.

What I mean is that in this case the functions do not "hide" each other because the signature differs. [f(void) vs. f(int)]

EDIT:
To be more clear. f(int) and f(void) are two completely different functions. As different as f(void) to g(int) would be.