How do you call the parent constructor in C++?

0 like 0 dislike
48 views
How to rewrite this code https://ideone.com/NE6NEW in C++?
Absolutely do not understand how there to carry out such inheritance :(
by | 48 views

1 Answer

0 like 0 dislike
In C++ must implement the constructor of the descendant
class Base { public: Base(int _i): i(_i) {//initialization block } private: int i; } class Derived : public Base { public: Derived(int _i): Base(_i) { //call super constructor } }
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
asked May 21, 2019 by DEATH2298
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
33,949 users