1. 纯虚类特点
纯虚类不能实例化;
class AES
{
public:
virtual ~AES()=0;
};
AES::~AES()
{
}
class BES:public AES
{
public:
virtual ~AES()=0;
};
int main()
{
AES *p=new BES;
delete p;
return 0;
}
// 通过基类的指针释放派生类对象;(虚函数实现)
1. 纯虚类特点
纯虚类不能实例化;
class AES
{
public:
virtual ~AES()=0;
};
AES::~AES()
{
}
class BES:public AES
{
public:
virtual ~AES()=0;
};
int main()
{
AES *p=new BES;
delete p;
return 0;
}
// 通过基类的指针释放派生类对象;(虚函数实现)
转载于:https://www.cnblogs.com/hj-blog/p/4448806.html