I have a problem with a destructor in a class that I created.
My constructor looks like this:
chess_b = new int*[N];
for (int i = 1; i <= N; i++)
chess_b[i] = new int[N];
and detructor like this:
for (int i = 1; i <= N; i++)
delete[] chess_b[i];
delete[] chess_b;
There are times eeerything works fine, but it crashes a lot and when I try to debug it points to this line of code:
delete[] chess_b[i];
I've tried using this-> but it didn't work either.
Thanks for help in advance.