小编Dav*_*oth的帖子

我如何派生一个具有带一些参数的构造函数的类?

我如何派生一个具有带一些参数的构造函数的类?

//The construction in base class:
BaseClass::BaseClass(int inArgument) :
    m_args (inArgument) // where m_args is a public/protected member of the base class
{

}
//The construction of derived class:
DerivedClass::DerivedClass(int inArgument) :
    m_args (inArgument) // where m_args is a public/protected member of the derived class
{

}
Run Code Online (Sandbox Code Playgroud)

编译后我得到:错误1错误C2512:'BaseClass':没有合适的默认构造函数可用

我是初学c ++程序员......

c++

2
推荐指数
1
解决办法
84
查看次数

标签 统计

c++ ×1