1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#include<iostream>
#include<algorithm>
using namespace std;
bool myComparsion(int a, int b)
{
return a < b;
}
int main()
{
int my[10] = { 1, 5, 4, 7, 8, 9, 6, -9, 11, 0 };
cout << max(my, myComparsion); //Error
//cout << max({ 1,5,4,7,8,9,6,-9,11,0 }, myComparsion); I don't want to use this form
return 0;
}
|