c++错误,求大神解答

基类的构造函数为Employee( const string&,const string&,int);
派生类的构造函数为Manager( const string&,const string&,int);
然后在派生类构造函数处报错误
c++error: no matching function for call to `Employee::Employee()'|
note: candidates are: Employee::Employee(const Employee&)|
Employee::Employee(const std::string&, const std::string&, int)|

Manager::Manager(const string id, const string name, int salary) :
Employee(id, name, salary)//此处要显式调用你定义的基类构造函数
{
}
否则默认调用Employee(),然而,这个构造函数并没有实现。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2016-07-07
把你调用的代码贴出来!按提示应该是你调用了默认构造函数!
相似回答