Check out example codes for "*max_element in c++". It will help you in understanding the concepts better.

Code Example 1

cout << " max element is: " << *max_element(array , array + n) << endl;

Code Example 2

// C++ program to demonstrate the use of std::max_element 
#include <iostream> 
#include <algorithm> 
using namespace std; 
int main() 
{ 
    int v[] = { 'a', 'c', 'k', 'd', 'e', 'f', 'h' }; 
  
    // Finding the maximum value between the first and the 
    // fourth element 
  
    int* i1; 
    i1 = std::max_element(v, v + 4); 
  
    cout << char(*i1) << "\n"; 
    return 0; 
}

Learn ReactJs, React Native from akashmittal.com