Hi all,
I'm trying to understand the code at the bottom of my post. I am working with a someone else's code and don't have a lot of experience in C++. My problem is that in the second loop it is accessing a field in an object pointed to by the first iterator. However, surely this iterator is now equal to the end of the array as it is the exit condition of the first loop.
Would someone be able to explain to me how this is working?
Any help would be much appreciated. Thanks.
Code:for(iter=M.mappings.begin(); iter!=M.mappings.end(); iter++) { another.erase(iter->target); s<< "\t\tdb"<<iter->target<<" [label=\""<<G2->getNodeAttrs(iter>source)->find("name")->second.value<<"\" shape=box style=filled fillcolor=lightblue color=blue];\n"; } for(p1=another.begin(); p1!=another.end(); p1++) { s<< "\t\tdb"<< (*p1)<<" [label=\""<<G2->getNodeAttrs(iter->source)- >find("name")->second.value<<"\" shape=box];\n";




Reply With Quote