[問題] compare function 與 search key
int a[10] = {0};
bool cmp(const int& i, const int& j)
{
cout << j << endl;
return i < j;
}
int main()
{
int key = 99999;
lower_bound(a, a+10, key, cmp);
return 0;
}
請問compare function裡面的第二個參數
是不是永遠都會是search key的值?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.115.154.208
推
04/21 14:28, , 1F
04/21 14:28, 1F
→
04/21 15:08, , 2F
04/21 15:08, 2F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章