Whyn't calling the function

Whyn’t calling the function if instead of
sort( r, r + n, compare);
I will give
sort( r, n, compare);

didn’t understand your doubt
can you explain your doubt

this statement is wrong
your Code is correct

The Parameter sequence is same, as well as the signature, then whyn’t calling the function instead of second parameter given as ( r ) with ( r + n )

this is because sort function accepts addresses only

https://www.cplusplus.com/reference/algorithm/sort/

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.

1 Like

Thanks Saurabh for the logical answer

@menaveen06 kindly give feedback from above link shared