-4

Is the Default Constructor of Super or Parent class Can be Inherited into Child class ?

closed as unclear what you're asking by amon, gnat, Greg Burghardt, TheCatWhisperer, maple_shaft Nov 26 '18 at 20:13

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

2

Constructors and destructors are never inherited. Instead they construct/destruct the base class, and the derived class needs its own constructor(s) which can invoke the appropriate constructor in the base class. If this is omitted then the default constructor gets called for the base class. If no default constructor exists, you must explicitly invoke the appropriate constructor in the base class.

Note that the constructor(s) in the base class(es) are always called before the body of the constructor(s) in the derived class is reached.

  • Do you know using Base::Base;? – Deduplicator Nov 26 '18 at 21:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.