This code is inside the constructor to a class. When I run my program it crashes and this is the output before it does so:
no problem here
or here
right here
this 0 0
0 output here
j: 0 k: 0 save[j][k]: 0
this 0 1
0 output here
j: 0 k: 1 save[j][k]: 17
at end of while loop
no problem here
or here
right here
this 0 0
0 output here
>Exit code: -1073741819
It looks like you have rows be 1, allocating the 2-d array with only one as the first dimension. i = 1 after the first for loop, then inside the while loop you access obstacles[i] (obstacles[1]) which is out of bounds. That looks like a problem to me, unless I'm misreading this.