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


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
59 views
How to rewrite this code https://ideone.com/NE6NEW in C++?
Absolutely do not understand how there to carry out such inheritance :(
by | 59 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
36,595 users