Search:
Forum
General C++ Programming
max "index" in container
max "index" in container
Aug 30, 2009 at 2:21pm UTC
Alan
(91)
I know there is
max_element()
but i need a function to return the index of the element instead of the actual value... any help?
Aug 30, 2009 at 2:39pm UTC
R0mai
(730)
std::find(c.begin(), c.end(), value)
where c is a container and value is... the value, hope that helps.
Aug 30, 2009 at 3:20pm UTC
Alan
(91)
thanks! just what i was lookin for
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs