#include < iostream > using namespace std; class base { int i; public: base(int n){ cout << "call base class constructor\n"; i = n; } ~base() { cout << "call base class destructor\n"; } void showi() { cout << i << '\n'; } }; class derived : public base { int j; public: derived(int n, int m): base(m){ cout << "call derived class constructor \n"; j = n; } ~derived() { cout << "call derived class destructor\n"; } void showj() {cout << j << '\n'; } }; int main() { derived o(10, 20); o.showi(); o.showj(); return 0; }