1 清空vector中的所有元素并释放内存:
1 vector<int*> xx; 2 for(int it=0;it!=xx.size();++it) 3 { 4 delete xx[it]; 5 } 6 xx.clear();