How would I make a loop that would simultaneously compute both the max and min of a vector?
Printable View
How would I make a loop that would simultaneously compute both the max and min of a vector?
Also see min_element, max_element
http://www.cplusplus.com/reference/a...m/min_element/
http://www.cplusplus.com/reference/a...m/max_element/
and if you are using c++11, minmax_element
http://www.cplusplus.com/reference/a...inmax_element/