• Advertisement
Sign in to follow this  

STL Map

This topic is 4362 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, i have a real quick and easy question: Does this get me the first or second item in a map? PriorityMapIter pos = m_PrioMap.begin(); pos++; i am trying to get the first item of the map thx a lot in advance

Share this post


Link to post
Share on other sites
Advertisement
That doesn't get you any element as such. However, it leaves pos as an iterator that points to the second element. Begin() points to the first element.

Share this post


Link to post
Share on other sites
Well, it's second in normal-person counting, but first in programmer-counting (it's common to hear experienced programmers talk about the "zeroth element" of an array for example) :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement