I have a window opengl appcilation, where I use a multi array, and when I try to close it, it gives the:
“Windows has triggered a brakepoint in app.exe.
This may be due to corruption of the heap…”
I have a header like this:
class MyClass
{
private:
static const int DATA_SIZE = 8;
double terrain[DATA_SIZE][DATA_SIZE]
...
}
In my app I give a value to each “edgepoint” like this:
terrain[0][0] = 5;
terrain[0][DATA_SIZE] = 5;
terrain[DATA_SIZE][DATA_SIZE] = 5;
terrain[DATA_SIZE][0] = 5;
If I comment out the last line (terrain[DATA_SIZE][0] = 5;), then there is no warning message, so the problem is with that line, but I don’t know what, it should work. I hope someone can help me. I use Visual Studio 2010 Ultimate.
You are overflowing the last element access index: use