I'm trying to fill a two-dimensional array of int in c++.
But i have a weird problem. Basically right now i have a code like that :
int array[83][86];
int test_1 = 0;
int test_2 = 0;
for (int x = box.min_corner().x(); x < box.max_corner().x(); x = x + 50)
{
for (int y = box.min_corner().y(); y < box.max_corner().y(); y = y + 50)
{
point_t point_p(x, y);
if (bg::within(point_p, poly))
{
array[test_1][test_2] = '1';
}
else {
array[test_1][test_2] = '0';
}
test_2++;
}
test_1++;
}
My program crashes before all columns are filled. Basically my program stop column 58. The problem is not my two for loops, because if I increase my array like this : int array[83 * 2][86]; It continues normally, as it is supposed to work initially.
Anyone have an idea of what can trigger this issue ?
box.min_corner()andbox.max_corner()?std::array<double, N>, or possibly loosely defined as any contiguous storage ofdouble. I avoid C-style “arrays”.