vector彻彻底底干干净净清理内存方法
vector <TestFree*> ::iterator iterp; //定义迭代器iterp = p_TestArray.begin();
while (iterp != p_TestArray.end())
{
delete *iterp; //先用迭代器释放空间,再用erase
iterp=p_TestArray.erase(iterp);
}
vector<TestFree* > (p_TestArray).swap(p_TestArray);
摘自 luhifeng
补充:软件开发 , Vc ,