#include <iostream>
class Base
{
public:
virtual void Foo() { std::cout << "Base::Foo "; }
virtual ~Base(){}
};
class Derived: public Base
{
public:
void Foo(int k = 0) { std::cout << "Derived::Foo "; }
};
int main()
{
Base *d = new Derived;
d->Foo();
delete d;
return 0;
}
Login in to like
Login in to comment