cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Again, from map iterator to 'natural' el
Again, from map iterator to 'natural' element order ?
Apr 19, 2011 at 2:40pm UTC
tonnot
(335)
I have this map :
map "a",1
map "d",1
map "e",1
map "w",1
I use an iterator to any purpose. Ok, I have my iterator located or pointing to item "e", the 3rd element or the element with index=2.
How can I find or extract this 'index'. ?
Thanks
Last edited on
Apr 19, 2011 at 2:41pm UTC
Apr 19, 2011 at 4:13pm UTC
Bazzy
(6281)
map iterators aren't random access, why would you need that?
You can start from yourmap.begin() and increment until you find a matching iterator but you should first consider whether what you are doing has some meaning
Topic archived. No new replies allowed.