I'm having a problem using std::upper_bound
here is the code:
# include <iostream>
# include <algorithm>
using namespace std;
It is returning 3, why is that shouldn't it return 2?
upper_bound returns an iterator
dereferencing the iterator gives you the element the iterator refers to. In this case it is the element at position 2, which is 3.
thank you very much.
Topic archived. No new replies allowed.