DEV Community

kevq
kevq

Posted on

[c++] max(min) value and index in array

#include<algorithm>
max_value = *std::max_element(array, array+size);
max_value_index = std::max_element(array, array+size) - array;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)