Comparators is not working

#include
#include
using namespace std;
bool compare(int a,int b)
{
return a>b;
}
void sort_stl(int a[],int n,compare)
{
sort(a,a+n);
}
int main()
{
int n;
cout<<“Enter the number of elements you want to sort”<<endl;
cin>>n;
int a[n];
cout<<“Enter the elements”<<endl;
for (int b=0;b<n;b++)
{
cin>>a[b];
}
sort_stl(a,n,compare);
cout<<“The sorted array is”<<endl;
for(int c=0;c<n;c++)
{

    cout<<a[c]<<endl;
}

return 0;

}

This is showing error in compiler.
can you please tell the error in this.

@juyal.sid
here you are passing compare function as a parameter to sort_stl() function, but whiling defining the sort_stl function you haven’t defined the parameter for compare correctly, you just wrote compare it doesn’t mean anything.
there is proper syntax for doing that.
i have done that for you, you can have a look at this code https://ide.codingblocks.com/s/254801
Also from the next time please share your code link after saving it as ide.codingblocks.com

@juyal.sid
for better understanding read this,

Declaration

A prototype for a function which takes a function parameter looks like the following:

void func ( void (*f)(int) );

This states that the parameter f will be a pointer to a function which has a void return type and which takes a single int parameter. The following function ( print ) is an example of a function which could be passed to func as a parameter because it is the proper type:

void print ( int x ) {
  printf("%d\n", x);
}

Function Call

func(print);

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.