12345678910111213141516171819202122
#include <iostream> class Base { public: Base(int temp) {variable = temp;} protected: int variable; }; class Derived: public Base { public: Derived(int temp) {variable = temp;} }; int main() { Derived d(25); return 0; }
12345
class Derived: public Base { public: Derived(int temp) : Base( temp ) {} };
123456
class Derived: public Base { public: using Base::Base; Derived() = delete; };