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

Code Example 1

// C++ program to demonstrate the use of std::min_element 
#include <iostream> 
#include <algorithm> 
using namespace std; 
int main() 
{ 
    int v[] = { 9, 4, 7, 2, 5, 10, 11, 12, 1, 3, 6 }; 
  
    // Finding the minimum value between the third and the 
    // fifth element 
  
    int* i1; 
    i1 = std::min_element(v + 2, v + 5); 
  
    cout << *i1 << "\n"; 
    return 0; 
}

Learn ReactJs, React Native from akashmittal.com