#74_Functors(Function Object) in C++

# include <iostream>
# include <functional>
# include <algorithm>
using namespace std;
//Functors(Function Object) in C++

int main(){
    int arr[7]={34, 2, 12, 7, 90, 67, 0};
    sort(arr, arr+5, greater<int>()); 
    for (int i = 0; i < 7; i++)
    {
        cout<<arr[i]<<" ";
    }
    cout<<endl;
    return 0;
}

Comments

Popular posts from this blog

#19_(2)Functions in C

Ch7_32_MethodOverloading

#72_Function Pointers in C