class A
{
public:
virtual int function () {
return 1;
}
int get() {
return this->function();
}
};
class B: public A
{
public:
int function() {
return 2;
}
};
#include <iostream>
int main() {
B b;
std::cout << b.get() << std::endl;
return 0;
}
Login in to like
Login in to comment