Archived

This topic is now archived and is closed to further replies.

gimp

[STL] How do I set an iterator to element 5?

Recommended Posts

Sneftel    1788
vector<int> v;
vector<int>::iterator i = v.begin() + 5;


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
Sneftel    1788
Nota bene: If you ever need an iterator to a particular input into a list or something, this won''t work. std::advance will be useful there.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites