STL Map

Started by
3 comments, last by Zahlman 18 years, 1 month ago
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
Advertisement
Second.

Dave

EDIT: New record, 2 seconds!
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.
thx a lot guys:)
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) :)

This topic is closed to new replies.

Advertisement