[STL] List iterators

Started by
19 comments, last by CWizard 20 years, 11 months ago
you can use the advance() function to move forward or backward but it will have bad complexity if a nonradom iterator is used. Take a look at the "STL Docs" link in Kylotan sig.


    list<int>::iterator i = L.begin();advance(i, 2);//2 is to move forward 2 spaces, -2 will backward    



-----------------------------
"There are ones that say they can and there are those who actually do."

"...u can not learn programming in a class, you have to learn it on your own."





[edited by - cMADsc on May 5, 2003 7:58:44 PM]
-----------------------------"There are ones that say they can and there are those who actually do.""...u can not learn programming in a class, you have to learn it on your own."

This topic is closed to new replies.

Advertisement