用父类指针指向子类对象
摘要:class A {public:A() { printf("A \n"); }~A() { printf(" ~A \n"); } // 这里不管写不写virtual,删除B对象的时候,都会被执行。因为这个例子是B*指针指向B对象,不是A*指针指向B对象。}; class B : public A{
阅读全文
posted @ 2016-11-21 23:06
posted @ 2016-11-21 23:06
posted @ 2016-08-18 23:09
posted @ 2016-08-16 22:56
posted @ 2016-08-16 22:55
posted @ 2016-08-16 21:49