Question: I have the following classes:

```
class A {
public:
    virtual void f() {}
};

class B : public A{
public:
    void f(int x) {}
};

```

If I say

```
B *b = new B();
b->f();

```

the compiler says error C2660: 'B::f' : function does not take 0 arguments. 
Shouldn't the function in B overload it, since it is a virtual function? Do virtual functions get hidden like this?

**EDIT**: I indeed meant to inherit B from A, which shows the same behaviour.

Answer: 
Class B does not derive from A so no function F() exists. You probably meant:

```
class A {
public:
    virtual void f() {}
};

class B : public A {
public:
    void f(int x) {}
};

```

**Edit:** I missed the actual function hiding. See Steve Jessop answer for more thorough explanation.
No, and yes, respectively. If you want the overloading behaviour, you need to say

```
using A::f;

```

in B.