指针释放出现问题,计算面积的方法没有被调用
deleting object of polymorphic class type 'shape' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
shape *p1 = new circle(3.2); shape *p2 = new rect(4.6,5.2); p1->jsmj(); p2->jsmj(); delete p1 p1 = NULL; delete p2; p2 = NULL; return 0;