摘要:
#include <iostream>using namespace std;class data{ int* value;public: data(int v){value = new int(v);} ~data(){delete value;} void display(){cout<<"指向的内存:"<<&*value<<endl;};};void testCopy(){ data m(10); data p = m; m.display(); p.display();}这段代码的问题是:delete被调用了2 阅读全文