grid = new char*[width]; for(int x = 0; x < width; x++) grid[x] = new char[height]; GameGrid::~GameGrid() { for(int x = 0; x < width; x++) delete[] grid[x]; delete[] grid; }