hey i have question, what if in the range i provide to max_element, there are two or more elements equal which are the largest?
which 1 would it return?
hey i have question, what if in the range i provide to max_element, there are two or more elements equal which are the largest?
which 1 would it return?
It returns (an iterator to) the first element in the range that is among the "largest".
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
ok ty
After you have found the first one, you can then repeatedly use std::find on the rest of the range.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)