#include usingnamespacestd;classBASE{public:virtual~BASE(){cout<<"Basedeconstruction"<} };classCCHILD:publicBASE{public:~CCHILD(){cout<<"CCHILDdeconstruction"<} };intmain(intargc,charconst*argv[]){BASE*Pbase;BASEb;Pbase=&b;deletePbase;cout<<"-----"<CCHILDc; Pbase=&c;deletePbase;return0;}请大神解释,delete为什么提示无效的指针啊
繁华开满天机
相关分类