vector <string> inputarrayconverted = { ... };
try
{
if (atoi(inputarrayconverted[p].c_str()) >= 0)
{
inputarrayconverted[p] = "n";
}
}
catch (int e) { }`
이 작동하지 않습니다. 그것은 나에게 "디버그 어설 션 실패!" 메시지. ! 벡터 표현 : 벡터 첨자 내가 할 노력하고있어 모든 배열 위치를 int 인 경우에 "N"arrayposition이 int 인 경우 ...?
오류가 "디버그 어설 션이 실패
파일의 값을 변경하는 것이 확인하다 범위를 벗어남 "
그러나 왜 내 시도 블록이이를 잡지 못하는 것입니까? 그게 내 질문이다.
이것은 스택 추적입니다.
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)가 나에게 "디버그 어설 션 실패!"를 표시하는 이유는 무엇입니까? 그것은 완벽하게 수용 가능한 코드처럼 보입니다 ... –
어설 션을 치면 스택 트레이스는 어떻게 생깁니 까? 어느 전화가 주장하고 있습니까? 'atoi()'? 'c_str()'? 배열 할당? – user1118321