I have a Board class where the constructor takes in the dimensions of the board as the parameter. I also have a Puzzle class that holds pieces and I want it to have a Board as a data member. I want it like this so that when I create an instance of Puzzle, I will have my instance of board created as well so I dont have to make seperate instances as a user. However, when I declare the board in my Puzzle.h file, it needs an actual number for the Board constructor.
i.e
/*Puzzle.h file*/
private:
Board theBoard(int height, int width); <- Yells at me for not having numbers
Is there a way to have an object of a class be a data member for another class if that object hasn't been created yet?