摘要:
#include <vector>using namespace std;class CDemo{public:CDemo():str(NULL){}~CDemo(){if(str) delete [] str;}char *str;};int main(){CDemo d1;d1.str = new char[32];strcpy(d1.str, "trend micro");vector <CDemo> *a1 = new vector <CDemo>();a1 -> push_back(d1);delete a1;return 阅读全文