16,472
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
using namespace std;
class Base
{
public:
void virtual func1()
{
cout<<"Base function1"<<endl;
}
void virtual func2()
{
cout<<"Base function2"<<endl;
}
};
class Derive:public Base
{
public:
void virtual func1()
{
cout<<"Derive function1"<<endl;
}
};
int main()
{
Base *pObj=new Derive();
return 0;
}