sir , In these code
why we call compare function like these :
sort(v.begin(),v.end(),compare);
and not like sort(v.begin(),v.end(),compare() );
{ why not use compare() as it is a function not a variable }?
Calling of compare function
Hi @yogesh22021998
If you put parentheses, you would be passing the result of calling the function, not the function itself. Without parenthesis we are passing the complete function itself. And sort function needs function as the third parameter not a variable.