컴파일러에서 push_back 작업을 시도 할 때까지 모든 것이 작동합니다. if 조건에 의 값이 반환됩니다.
내가 선언 한 항목으로 :벡터 push_back으로 인해 처리되지 않은 예외가 발생합니다.
Unhandled exception at 0x5052ad4a (msvcp100d.dll) in PrefixScan.exe: 0xC0000005: Access violation reading location 0x3d4cccd1.
추신 : 내가 사용 하나 개 더 기능이
vector<int> items; // inside the header file.
//
void MsPs::findnSort()
{
for(int i = 1; i<50 ; i++)
{
string temp = static_cast<ostringstream*>(&(ostringstream() << i))->str(); // TO convert int i to a string temp
if(findSupport(temp) >= MIS[i])
{
items.push_back(i);
}
}
}
다음과 같은 오류가 팝업 .cpp 파일 내부 push_back 작업은 잘 작동합니다.
아무도 도와 줄 수 있습니까? 나는 문제가 ostringstream이 때 정적 캐스트 수익을 파괴되는 것을 생각
void MsPs::findnSort()
{
for(int i = 1; i<50 ; i++)
{
items.push_back(i);
}
}
'MIS'의 크기는 얼마입니까? – billz
크기는 50이지만 디버깅하는 동안 코드는 첫 번째 단계까지 진행되지 않습니다. – AdRoiT
메모리가 다른 곳에서 손상되었습니다. 디버거를 사용하여 호출 스택을 확인하고, 잘못된 것을 찾아야합니다. – billz