-4

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

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.

1
  • 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.