You do not need to use std::vector<>, but this is easiest if you first get your data into the correct data type:
#include <cstdint>
struct mystruct
{
std::int64_t first, second;
};
, , , - .
operator< :
#include <algorithm>
bool operator <(mystruct const& ms, std::int64_t const i)
{
return ms.first < i;
}
int main()
{
mystruct mss[10] = { };
std::int64_t search_for = ;
mystruct* found = std::lower_bound(mss, mss + 10, search_for);
}
std::lower_bound:
#include <algorithm>
struct mystruct_comparer
{
bool operator ()(mystruct const& ms, std::int64_t const i) const
{
return ms.first < i;
}
};
int main()
{
mystruct mss[10] = { };
std::int64_t search_for = ;
mystruct* found = std::lower_bound(mss,
mss + 10,
search_for,
mystruct_comparer());
}
, ++ 11 .