If anyone could help me with reading over my program to see where I have an error it would be much appreciated.
I already have the entire program written (teacher provided some come and then student -me- fills in rest of code and finishes particular functions), but are error(s).
It has to do with creating multiple dynamic 2d arrays.
Any help would be appreciated, please PM or leave a comment. Will tip FG for assistance.
I believe the error is within where I create the 2d array in a method:
//row and col are private members of the class. row = 5, col = 5.
Code
int ** Life::buildGrid()
{
int **ngrid;
ngrid = new int*[row + 2];
for (int i = 0; i < row + 2; i++)
{
ngrid[i] = new int[col + 2];
for (int j = 0; j < col + 2; j++)
{
ngrid[i][j] = 0;
}
}
return ngrid;
}
This post was edited by SleepyUnit on Jun 3 2014 05:00pm