0xC0000005中0x770115de处未处理的异常:使用递归矢量搜索读取位置0xccccccc0时发生访问冲突
Unhandled exception at 0x770115de in : 0xC0000005: Access violation reading location 0xccccccc0 with recursive vector search
daedalus_1.4.exe中0x770115de处未处理的异常:0xC0000005:读取位置0xccccccc0的访问冲突。
string temp;
string locName = "0";
vector<vector<string>> l;
int m = 100, n = 3; //vector dimension
l.resize(m);
for(int i = 0; i < m; ++i) l[i].resize(n);
temp.clear();
if(line.substr(1, 17) == "Timing LocationID" && arrayFull == true) {
int i = 0; //starting char
while (line[i++] != '='); //increment to next
while (line[++i] != '"') temp += line[i];
locName = findLocation(temp, 0, "", l);
string findLocation (string temp, int index, string locName, vector<vector<string>> &l)
{
if (temp == "*") return locName; // <------errors here on return
if (l[index][0] == temp) findLocation(l[index][1], 0, locName.insert(0,l[index][2]), l);
else findLocation(temp, ++index, locName, l);
}
此函数循环通过一个2xvector,并返回一个由parent->childvector单元格组成的串联字符串
这些来自调用堆栈;看起来像字符串析构函数
__CLR_OR_THIS_CALL ~basic_string()
{ // destroy the string
_Tidy(true);
}
void __CLR_OR_THIS_CALL _Tidy(bool _Built = false,
size_type _Newsize = 0)
{ // initialize buffer, deallocating any storage
if (!_Built)
;
else if (_BUF_SIZE <= _Myres)
{ // copy any leftovers to small buffer and deallocate
_Elem *_Ptr = _Bx._Ptr;
if (0 < _Newsize)
_Traits_helper::copy_s<_Traits>(_Bx._Buf, _BUF_SIZE, _Ptr, _Newsize);
_Mybase::_Alval.deallocate(_Ptr, _Myres + 1);
}
_Myres = _BUF_SIZE - 1;
_Eos(_Newsize);
}
您的函数字符串findLocation()
没有在所有路径上返回值,也许你的意思是:
string findLocation (string temp, int index, string locName, vector<vector<string>> &l)
{
if (temp == "*") return locName;
if (l[index][0] == temp) return findLocation(l[index][1], 0, locName.insert(0,l[index][2]), l);
else return findLocation(temp, ++index, locName, l);
}
相关文章:
- 0xC0000005:访问冲突读取位置 0x00000000. 重载 == 运算符的问题
- (此函数用于计算 SMA).在 FA.exe 中0x00509159引发异常: 0xC0000005:访问冲突读取位置0
- 0xC0000005:读取位置0xCDCDCDC1时发生访问冲突
- 0xC0000005:读取位置0xCDCDCDCD时发生访问冲突
- 读取类的析构函数中的位置时发生访问冲突
- 0x0F50DF58:0xC0000005:访问冲突读取位置0x0047CA04时未处理的异常
- 在 DLL 中嵌入 Python:Py_DECREF列表对象时访问冲突读取位置
- 0xC0000005:访问冲突读取位置0x0000000000000008
- C++访问冲突读取位置0xDDDDDDCD当我尝试删除已更新的数组时
- 使用向量的函数崩溃,调试器说访问冲突读取位置
- 如何在c++中从txt文件的随机位置读取数据
- 从C 中的特定位置读取文本文件的一行
- 如何从字符 * 缓冲区中的位置 y 读取 x 个字符
- 从文件C++中的特定位置读取
- Xcode 4输出文件并从奇怪的位置读取
- 如何从最后一个光标位置读取文件
- 如何从字符串流中的同一位置读取两次
- 从搅拌机的特定内存位置读取数据(结构)
- <向量>线程安全在不同位置读取/写入吗?
- 从位置读取文件(到位置)