又崩溃了!!求解崩溃原因~
#include <iostream>using namespace std;
class A {
public:
~A() { cout << "析构A\n"; }
};
class B : virtual public A { //删掉virtual 没有报错
public:
~B() { cout << "析构B\n"; }
};
int main() {
A *p = new B;
delete p;
return 0;
}
这段代码在vc 6.0中崩溃 但删掉virtual 没有报错 求解崩溃原因~