#include<iostream>
using namespace std;
class Base
{
class Derived : public Base
{
void main()
{
using namespace std;
class Base
{
private:
int a;
public:
};Base(int i) { a = i; cout << "Constructing Base a = " << a << endl; }~Base() { cout << "Destroying Base a = " << a << endl; }
class Derived : public Base
{
private:
int d;
public:
};Derived(int i, int j) : Base(i) // 向基类 Base 的构造函数传递参数 i{d = j;cout << "Constructing Derived d = " << d << endl;}~Derived() { cout << "Destroying Derived d = " << d << endl; }
void main()
{
Derived d(5, 8);}