#include <iostream>
using namespace std;
class A
{
public:
virtual void Foo(int n = 10)
{
cout << "A::Foo, n = " << n << endl;
}
};
class B : public A{
public:
virtual void Foo(int n = 20) {
cout << "B::Foo, n = " << n << endl;
}
};
int main()
{
A * pa = new B();
pa->Foo();
return 0;
}
Login in to like
Login in to comment