class A {
public:
void func1() {
cout << "A1" << endl;
}
virtual void func2() {
cout << "A2" << endl;
}
};
class B : public A {
public:
void func1() {
cout << "B1" << endl;
}
void func2() {
cout << "B2" << endl;
}
};
int main() {
A *a = new B;
a->func1();
a->func2();
}