A
Angus
Hi
using lower_bound I want to pass a 2-dimensional array eg like this:
static const int tbl[5][3] = {
1000, 800, 801,
1001, 802, 803,
1002, 804, 805,
1003, 806, 807,
1004, 808, 809
};
I want to search in only the first column - eg the numbers 1000-1004.
I am trying to find the position in this 2-dimensional array, and then
once located I can access elements[position][1] and elements[position]
[2].
I tried this:
int arrsize = sizeof(tbl)/sizeof(tbl[0]);
low=lower_bound(tbl[0], tbl[0]+arrsize, 7);
But get compile error C2440 cannot convert from 'const int *' to 'int
*'
How can I do this?
Angus
using lower_bound I want to pass a 2-dimensional array eg like this:
static const int tbl[5][3] = {
1000, 800, 801,
1001, 802, 803,
1002, 804, 805,
1003, 806, 807,
1004, 808, 809
};
I want to search in only the first column - eg the numbers 1000-1004.
I am trying to find the position in this 2-dimensional array, and then
once located I can access elements[position][1] and elements[position]
[2].
I tried this:
int arrsize = sizeof(tbl)/sizeof(tbl[0]);
low=lower_bound(tbl[0], tbl[0]+arrsize, 7);
But get compile error C2440 cannot convert from 'const int *' to 'int
*'
How can I do this?
Angus