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?
This is a discussion on max_element within the C++ Programming forums, part of the General Programming Boards category; hey i have question, what if in the range i provide to max_element, there are two or more elements equal ...
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".
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
ok ty
After you have found the first one, you can then repeatedly use std::find on the rest of the range.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way