I've created an 2D array in C++ like this:
Board::Board(int rows, int cols){
places = new int*[rows];
for (int row = 0; row < rows; row++){
places[row] = new int[cols];
for (int col = 0; col < cols; col++){
places[row][col] = 0;
}
}
}
And that works pretty well. Yet now i want to make a function which needs the length of the rows and columns of the array. I've tried a bit with the function:
sizeof()
But i only got it working with a normal array to return the length.
How to do this without declaring global variables for rows and cols?