子类析构函数无法执行的原因?

问题 只执行了父类析构函数,而没有执行子类析构函数。
问题相关代码
# include <iostream>
# include <cstring>
using namespace std;
class Base
{
private:
int data;
public:
Base (int d)
{
data = d;
cout << "Constructor of Base. data ="<< data << endl;
}
~Base ()
{
cout << "Destructor of Base. data ="<<data<<endl;
}

};

class Derived: public Base
{
private:
char *data;
public:
Derived (const char *s) : Base (strlen(s))
{
data = new char[strlen (s) + 1];
strcpy (data,s);
cout << "Constructor of Derived.data ="<< data << endl;
}
~ Derived ()
{
cout << "Destructor of Derived.data ="<< data << endl;
delete []data;
}
};

int main()
{
Base *p;
p=  new Derived ("derive");
delete p;
return 0;
}
运行结果及报错内容

Constructor of Base. data =6
Constructor of Derived.data =derive
Destructor of Base. data =6

我想要达到的结果

完整输出

用父类指针销毁对象无法找到子类对象的析构函数,需要在父类析构函数之前加virtual关键字。