本文介绍了删除矢量**的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

有什么问题?为什么? : - ?



 std :: vector< int> ** indices =  new  std :: vector< int> * [ 8 ]; 
for int i = 0 ; i< 8 ; i ++)
{
indices [i] = new std :: vector< int> [ 8 ];
}

// statments ...

for int i = 0 ; i< 8 ; i ++)
{
// 问题在这里!!!
// 调试断言失败!
// 表达式:_BLOCK_TYPE_IS_VALID(pHead-> nBlockUse)
delete indices [i];
}
删除索引;
解决方案



你忘了删除对象数组上的[] ,使用:

  delete  [] indices [i]; 




hi to all.
What is the problem? why? :-?

std::vector<int>** indexes = new std::vector<int>*[8];
for(int i = 0; i < 8; i++)
{
    indexes[i] = new std::vector<int>[8];
}

//statments...

for(int i = 0; i < 8; i++)
{
    //problem is here !!!
    //Debug Assertion Failed!
    //expression : _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
    delete indexes[i];
}
delete indexes;
解决方案


you forgot to delete[] on the array of objects, use:

delete [] indexes[i];




这篇关于删除矢量**的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 09:47
查看更多