class Suduko { private: vector<vector<string>> board; public: Suduko() : board(9, vector<string>(9, ".")) {} } Is this the only way to do it?
I've tried initializing it right where board is defined with vector<vector<string>> board(9, vector<string>(9, ".")); but that doesnt work.
I also tried:
Suduko() { board(9, vector<string>(9, ".")); } and
Suduko() { board = board(9, vector<string>(9, ".")); } inside of the constructor and those didn't work either. So am I limited to initializing the vector to the way I did in the first example (which did work)? Or is there another way I can do it?
vectorisn't special. Look up how to initialize any data member and you'll have your answer.