I'm trying to set up a 2-d array of objects. I want the array to be accessible to the whole class that it is defined in but I don't know how big the array is right away. What is the correct way to do this? I don't think the way I have it now is correct:
Is this right?Code:class Game
{
private:
MyObject* myArray;
public:
Game(int rows,int cols)
{
myArray[rows][cols];
}
}