#include <iostream>
using namespace std;
class A
{
public:
virtual void foo()
{
cout << "A::foo" << endl;
}
};
class B : public A
{
public:
void foo(int param)
{
cout << "B::foo " << param << endl;
}
};
int main()
{
B b;
b.foo();
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgQQp7CnB1YmxpYzoKICAgIHZpcnR1YWwgdm9pZCBmb28oKQogICAgewogICAgICAgIGNvdXQgPDwgIkE6OmZvbyIgPDwgZW5kbDsKICAgIH0KfTsKCmNsYXNzIEIgOiBwdWJsaWMgQQp7CnB1YmxpYzoKICAgIHZvaWQgZm9vKGludCBwYXJhbSkKICAgIHsKICAgICAgICBjb3V0IDw8ICJCOjpmb28gIiA8PCBwYXJhbSA8PCBlbmRsOwogICAgfQp9OwoKaW50IG1haW4oKQp7CiAgICBCIGI7CiAgICBiLmZvbygpOwp9
prog.cpp: In function ‘int main()’:
prog.cpp:25:11: error: no matching function for call to ‘B::foo()’
b.foo();
^
prog.cpp:25:11: note: candidate is:
prog.cpp:16:10: note: void B::foo(int)
void foo(int param)
^
prog.cpp:16:10: note: candidate expects 1 argument, 0 provided