请大家帮忙看个小程序
#include <iostream.h>
class Base
{
public:
virtual ~Base() { cout < < "~Base " < < endl ; }
};
class Derived : public Base
{
public:
virtual ~Derived() { cout < < "~Derived " < < endl ; }
};
void main(void)
{
Base * pB = new Derived; // 这句是什么意思?
delete pB;
}
--------------------------
[解决办法]
那就再认真读几遍吧,记得多做书上的习题。
熟能生巧,没有其它捷径的。