#include<iostream>
using namespace std;
class Base{
public:
void fn1(){
cout<<"Base fn1开始"<<endl;
}
void fn2(){
cout<<"Base fn2开始"<<endl;
}
};
class Derived:public Base{
public:
void fn1(){
cout<<"Derived fn1开始"<<endl;
}
void fn2(){
cout<<"Derived fn2开始"<<endl;
}
};
int main()
{
Derived d;
d.fn1();
d.fn2();
Base *p1=&d;
p1->fn1();
p1->fn2();
Derived *p2=&d;
p2->fn1();
p2->fn2();
return 0;
}