#include
#include
using namespace std;
bool compare(int a ,int b)
{
return a>=b;
}
int main()
{
int a[10]={1,2,4,5,6,7,8};
int k= 3;
int *lb = lower_bound(a,a+7,k,compare);
int j=lb-a;
cout<<j<<endl<<a[j];
here i get the output as 7 and 0 which means i got the value at 7th index which means 0 but i wanted that the value i should get is 1 and 2 beacuse i changed the compare function.what is the problem in this . please explain?