First chance exception:crash
list<Pnt*>::iterator start =hex_cplist_combine->PntList_xy.begin();
list<Pnt *>::iterator end ;
for(start; start !=hex_cplist_combine->PntList_xy.end()
{
//FreePntArr();
g_ObjRecSetup.mappingsetup.CartStarter.x = (*start)->x;
g_ObjRecSetup.mappingsetup.CartStarter.y = (*start)->y;
end=hex_cplist_combine->PntList_xy.begin();
//for(end; end !=cart_cplist->PntList_xy.end()
for(end; end !=hex_cplist_combine->PntList_xy.end()
{
Curve * pPolarPath, * pCartPath;
pPolarPath = newCurve();
pCartPath = newCurve();
try
{
g_ObjRecSetup.mappingsetup.CartEnd.x= (*end)->x;
g_ObjRecSetup.mappingsetup.CartEnd.y = (*end)->y;
}
catch (exception& e)
{
AddReportData(0,"exception caught:%s",e.what());
}
display();
end++;
}
start++;
}
Above is the part of my code.I keep getting first chance exception at the line highlighted in bold.My code also crashes and I cant figure out why?The list does have values and nothing is null as far as I checked.
Thanks
Shweta
Re: First chance exception:crash
You can't dereference an end iterator: It points past the last item in the container. You can't increment an end iterator either, BTW.
Unlike the original in that ancient thread, this post doesn't have any line highlighted in bold, BTW. And please use code tags when posting code. The way it is now, your code is almost absolutely unreadable.