Multi-Dimensional Vector Problem

So I am writing a TicTacToe game, in which a multi dimensional array is recommended. I am trying to make a board using one but to no avail

1
2
3
4
5
  class PlayingBoard{
	/*TicTacToe Board*/
	std::vector< std::vector<char> > board = { { '_', '_', '_' },
{ '_', '_', '_' }, 
{ '_', '_', '_' }};//<--Error here 


The error states: Error 1 error C2664: 'std::vector<std::vector<char,std::allocator<char>>,std::allocator<_Ty>>::vector(std::initializer_list<std::vector<char,std::allocator<char>>>,const std::allocator<_Ty> &)' : cannot convert argument 1 from 'initializer-list' to 'unsigned int'


What does this mean and how can I fix it?
Last edited on
Add another curly brackets around init list:
1
2
3
std::vector<std::vector<char>> board = {{{ '_', '_', '_' },
                                         { '_', '_', '_' }, 
                                         { '_', '_', '_' }}};
Thanks that fixed the issue, I knew it was some dumb little thing like that :(
Topic archived. No new replies allowed.