Hi @prateek_5, here cmp is the reference to the function that is being passed as parameter and “&” is used for call by reference .
Note : If we had called "void bubble_sort (int a [ ] , int n , bool ( *cmp)( int
a , int b)) in that case it would be call by address and cmp would be pointer to the function passed in the parameter .
whenever we pass comparator function to a function ,say a sorting function , then all the comparisons are made through the comparator function so we can just modify the comparator function to get the desired order.
For a comparator function used for sorting , comparator function takes two argument say , comparator(data_type a, data_type b) then this function will return true if a should come first in the desired order and will return false if b should come first
In case of any doubt feel free to ask
if you got your answer then mark your doubt as resolved
a like would be a bonus