#include <iostream>
using namespace std;
class A{
public:
int f(){
return 1;
}
int g(){
return f()+1;
}
};
class B: public A{
public:
int f(){
return 3;
}
};
int main() {
A a;
B b;
cout << a.g() << b.g() << endl;
}
Login in to like
Login in to comment