return max element in vector tc++ code example Example: max element in vector c++ auto max = *max_element(vector.begin(), vector.end());