I'm having a bit of trouble figuring out this error I have. So I have a Person class, and a Student subclass.
The Person class has the following constructor:
Person(const string &name)
{ this->name = name;
}
The Student class has the following constructor:
Student::Student(const string &name, int regNo)
{ this->name = name;
this->regNo = regNo;
}
When I try to compile the Student class though, I get this error for the constructor:
In constructor 'Student::Student(const string&, int)':
error: no matching function for call to 'Person::Person()'
I'm new to C++, so I have no idea why I get this error, but it has something to do with the inheritance of Person obviously.