vendredi 5 novembre 2021

how to specify constructor in header for child and parent class

I am new to C++ and define a parent class in a header file parent.h. It has a constructor Parent(int a, int b).

Now I want to write the header file for the child class child.h, which inherits the exact same constructor as the parent class and only has additional member functions.

Do I have to specify the constructor in the child's header file as well? (Child(int a, int b)) Or do I only specify the signatures for the additional member functions and specify the constructor in the corresponding child.cppfile?

Aucun commentaire:

Enregistrer un commentaire