error: cannot convert ‘DerivedClass*‘ to ‘BaseClass*‘ in initialization(不能转换*到*在初始化)
#include
using namespace std;
class BaseClass
{
public:
BaseClass(){cout<<“BaseClass constructor “<<endl;}
void fn1(){cout<<“Base1”<<endl;}
void fn2(){cout<<“Base2”<<endl;}
~BaseClass(){cout<<“BaseClass destructor”
原创
2020-12-13 21:36:45 ·
1914 阅读 ·
0 评论