Does VC++ 6.0 not support dynamic cast?# Programming - 葵花宝典
n*d
1 楼
How come this code crash in runtime by VC++ 6.0?
#include
using namespace std;
class Pet { public: virtual ~Pet(){}};
class Cat : public Pet {};
int main() {
Pet* b = new Cat; // Upcast
Cat* d = dynamic_cast(b);
}
#include
using namespace std;
class Pet { public: virtual ~Pet(){}};
class Cat : public Pet {};
int main() {
Pet* b = new Cat; // Upcast
Cat* d = dynamic_cast
}