vector <string> inputarrayconverted = { ... };
try
{
if (atoi(inputarrayconverted[p].c_str()) >= 0)
{
inputarrayconverted[p] = "n";
}
}
catch (int e) { }`
不管用。它给了我一个“调试断言失败!” 信息。我要做的就是验证如果数组位置是 int,则将其值更改为“n”
错误是“调试断言失败!
文件:向量表达式:向量下标超出范围"
但是,为什么我的 try 块没有捕捉到这个?那是我的问题。
这是堆栈跟踪。(我相信)
msvcp100d.dll!590599f3()
[Frames below may be incorrect and/or missing, no symbols loaded for msvcp100d.dll]
Paradigms Assignment 2 C Plus Plus.exe!std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::operator[](unsigned int _Pos=0) Line 932 + 0x17 bytes C++
Paradigms Assignment 2 C Plus Plus.exe!wmain(int argc=1, wchar_t * * argv=0x00314af8) Line 148 + 0x12 bytes C++
Paradigms Assignment 2 C Plus Plus.exe!__tmainCRTStartup() Line 552 + 0x19 bytes C
Paradigms Assignment 2 C Plus Plus.exe!wmainCRTStartup() Line 371 C
kernel32.dll!7647339a()
ntdll.dll!77909ef2()
ntdll.dll!77909ec5()