64,682
社区成员
发帖
与我相关
我的任务
分享
int getRoadSeq(int start,int end)
{
char mstr[20];
sprintf(mstr,"%d+%d",start,end);
string str(mstr);
map<string ,int>::iterator miter = nodeidtoRoad.find(str); // 几次运行都是在这里溢出
if(miter == nodeidtoRoad.end()) return -1;
return miter->second;
}
int getNextNode(int nodeid)
{
if( vmap[nodeid].empty() )
return -1;
vector<int> li = vmap[nodeid]; //这个只是复制拷贝,也没有溢出
int nextnode = li[0];
return nextnode;
}