Well since this is C++ and you are new to it, I suggest you using the std::string class. This is by far the easiest way for new C++ programmers:
Code:
#include <string>
using namespace std;
string grid[3][3] = {
{ " ", " ", " " },
{ " ", " ", " " },
{ " ", " ", " " }
};
Or if you're feeling adventurous and want to do it the C way:
Code:
char *grid[3][3] = {
{ " ", " ", " " },
{ " ", " ", " " },
{ " ", " ", " " }
};
Watch out there because you need to reallocate strings when you want to put something in it and delete after. Or if you don't want to do that, you can risk buffer overflows and use fixed-length strings, where 10 is the max size of each string including the null character (so 9 real characters total). You can change that number, of course:
Code:
char grid[3][3][10] = {
{ " ", " ", " " },
{ " ", " ", " " },
{ " ", " ", " " }
};
Again, note that arrays are zero-based. The first element is not at one, its at zero. So these are the bounds: grid[0..2][0..2]