I want to first initialize "dummy" array when i create a object. I have this in private part of my class.
// Initialize dummy array when object is initialized.
int* matrix_[0][0];
Then i want later to initialize new array to replace the dummy one (one that has actual size). I have method for this in my class:
void set_map_size(int width, int height) {
int* pm[width][height];
matrix_ = pm;
}
So the problem is when I try to initialize this array after the creation of the object. I want other methods / other objects to have access to this array.
Maybe I should have pointer? Initialize pointer as nullptr when object is created and then change pointer to point to array?