执行结果问题
#include<iostream>
#include"Circle.h"
#include"Rect.h"
#include"Shape.h"
using namespace std;
int main()
{
Shape *shape1 =new Rect(4,5);
Shape *shape2 = new Circle(6);
shape1->calcArea();
shape2->calcArea();
delete shape1;
shape1 = NULL;
delete shape2;
shape2 = NULL;
system("pause");
return 0;
}
运行结果shape1中不跳至Rect类,为什么啊