max of a vector in c++ code example
Example 1: maximum in vector
*max_element(a.begin(), a.end());
Example 2: max element in vector c++
auto max = *max_element(vector.begin(), vector.end());
Example 3: c++ max and min of vector
template <typename T, size_t N> const T* mybegin(const T (&a)[N]) { return a; }
template <typename T, size_t N> const T* myend (const T (&a)[N]) { return a+N; }