#include <iostream>
using namespace std;
class ABase {
public:
void f(int i) const { cout << 1;}
void f(char ch) const { cout << 2; }
};
class BBase {
public:
void f(double d) const { cout << 3;}
};
class ABBase : public ABase, public BBase {
public:
void f(char ch) const { cout << 4; }
};
void g(ABBase& ab) {
ab.f('c');
ab.f(2.5);
ab.f(4);
}
int main() {
ABBase ab;
g(ab);
}
Login in to like
Login in to comment