0 votes
in C Plus Plus by

Does a derived class inherit or doesn't inherit?

1 Answer

0 votes
by

When a derived class is constructed from a particular base class, it basically inherits all the features and ordinary members of the base class. But there are some exceptions to this rule. For instance, a derived class does not inherit the base class’s constructors and destructors.

Each class has its own constructors and destructors. The derived class also does not inherit the assignment operator of the base class and friends of the class. The reason is that these entities are specific to a particular class and if another class is derived or if it is the friend of that class, then they cannot be passed onto them.

Related questions

0 votes
asked Jun 18, 2020 in C Plus Plus by Robindeniel
0 votes
asked Jun 11, 2020 in C Plus Plus by Robindeniel
...