删除vector中内存

来源:互联网 发布:php 互换数组里面的值 编辑:程序博客网 时间:2024/05/01 09:19
for (vector<void *>::iterator it = Myvec.begin(); it != Myvec.end(); it ++)
{


if (NULL != *it)
{

delete *it;
*it = NULL;
}
}
0 0