摘要:
delete void pointer是否会有内存泄漏?看下面一个简单例子class Test{public: Test(){ printf ("constructor\n"); } ~Test(){ printf("destructor"); }};int main(int argc, char *argv[]){ Test *p = new Test(); void *p1 = p; delete p1; printf("the end\n"); getchar(); return 0;} 结果输出:从输出可以看出来,没有调用类的 阅读全文