A *pA=NULL;
B *pB=NULL;
pA=new B();
delete pA;
程序调试打印输出结果是 A() B() ~B();
pB=new B();
delete pB;
程序调试打印输出结果是 A() B() ~B();
如果上面的类A的"virtual ~A()"成员函数去掉virtual关键字,则
pA=new B();
delete pA;
程序调试打印输出结果是 A() B() ~B() ~A();
pB=new B();
delete pB;
程序调试打印输出结果是 A() B() ~B() ~A();