vector <string> inputarrayconverted = { ... };
try
{
if (atoi(inputarrayconverted[p].c_str()) >= 0)
{
inputarrayconverted[p] = "n";
}
}
catch (int e) { }`
が機能しません。それは私に "デバッグアサーション失敗!"メッセージ。 !ベクトル 式:ベクトル添字私がやろうとしているすべては、配列位置がint型である場合、その値を変更するには、「n」はarraypositionがintの場合...?
エラーが ある「デバッグアサーションが失敗したことを
ファイルを確認しています範囲外 "
しかし、なぜ私の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()
ご質問はありますか? – user1118321
私のコンパイラ(VS2010)が私に "Debug Assertion Failed!"を与えるのはなぜですか?それは完全に受け入れられるコードのようです... –
アサーションをヒットしたときのスタックトレースはどのように見えますか?どのコールがアサートしていますか? 'atoi()'? 'c_str()'?配列の割り当て? – user1118321