min : min « STL Algorithms Min Max « C++ Tutorial






#include <iostream>
using std::cout;
using std::endl;

#include <algorithm>

int main()
{
   cout << "\nThe minimum of 'G' and 'Z' is: " << std::min( 'G', 'Z' );
   cout << "\nThe minimum of 12 and 7 is: " << std::min( 12, 7 );
   cout << endl; 
   return 0;
}
The minimum of 'G' and 'Z' is: G
The minimum of 12 and 7 is: 7








29.3.min
29.3.1.min
29.3.2.Call min() with special comparison function
29.3.3.Use max and min functions