destructor
This commit is contained in:
committed by
JamesFlare1212
parent
7f7b936341
commit
34f972e3f4
@@ -21,6 +21,12 @@ public:
|
||||
|
||||
class Student : public Human {
|
||||
public:
|
||||
/* in C++, when a derived class inherits from a base class,
|
||||
* the base class's constructor must be called to initialize its members.
|
||||
* This is because the base class may contain private or protected members
|
||||
* that are not directly accessible by the derived class.
|
||||
* Therefore, the derived class relies on the base class's constructor to properly initialize these members. */
|
||||
|
||||
Student(std::string n, int a, int s) : Human(n, a, s) {}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user