c++ max of 2 values code example
Example 1: max three values c++
int a = 1;
int b = 2;
int c = 3;
int m = std::max({a, b, c});
Example 2: max two numbers c++
template <class T> inline T max(T a, T b)
{
return a > b ? a : b;
}
//Example: max(2,5) = 5