I'm studying STL and made win32 project..
But I got stuck in runtime error..
I tried to debug it but..
(partial code)
vector<Vertex> currPoly=polygons.back();
vector<Vertex>::iterator it;
for(it=currPoly.begin();it!=currPoly.end();++it){
vector<Vertex>::iterator p1;
vector<Vertex>::iterator n1;
vector<Vertex>::iterator n2;
if( it==currPoly.begin()){
p1=currPoly.end();
n1=it+1;
n2=it+2;
}else if( it==currPoly.end()-1){
p1=it-1;
n1=it+1;
n2=currPoly.begin();
}else if( it==currPoly.end()){
p1=it-1;
n1=currPoly.begin();
n2=currPoly.begin()+1;
}else{
p1=it-1;
n1=it+1;
n2=it+2;
}
int tmp;
tmp=it->x;
tmp=p1->x;
please click to see debugging picture
this is very strange because
in watch table,
n1,p1,it are defined but n2 isn't and tmp is not either..
I can't find what is wrong...
please help..