I'm new to C++ but have had experience before with languages like java and I am starting off by making a simple command line Xs and Os game. When it came to creating the grid I found that I could initiate it in two different ways:
int grid[3][3] = {{0, 0, 0 },
{0, 0, 0 },
{0, 0, 0 }};
and:
int grid[3][3];
for (int x = 0; x < 3; ++x)
{
for (int y = 0; y < 3; ++y)
{
grid[x][y] = 0;
}
}
Is one method better than the other in any way and should I get into a habit of using one rather than the other?
Thanks