max value in a vector c++ code example
Example 1: maximum in vector
*max_element(a.begin(), a.end());
Example 2: max of a vector c++
cout<<*max_element(a.begin(), a.end())<<endl;
Example 3: c++ max and min of vector
auto it = max_element(std::begin(cloud), std::end(cloud)); // c++11
Example 4: 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; }