bool compare (int a,int b) {
return a<=b;
}
example: int a[ ] = {10,20,30,40,50,60, 70}
if i do *(lower_bound (a, a+7 , 40 , compare)) ;
then this function returns the value 50 , ideally it should have returned 40 , i dont understand why this is happening ? please tell?
same concept is used in money change problem . so i dont understand it as well.