我在处理这个错误时遇到了一些麻烦。所以我有一个Person类和一个Student子类。C++继承获取错误
Person类具有下面的构造:
Person(const string &name)
{ this->name = name;
}
学生类具有以下构造:
Student::Student(const string &name, int regNo)
{ this->name = name;
this->regNo = regNo;
}
当我尝试虽然编译Student类,我得到这个错误的构造函数:
In constructor 'Student::Student(const string&, int)':
error: no matching function for call to 'Person::Person()'
我是新来的C++,所以我不知道为什么我得到这个呃但是这显然与人的继承有关。