Printing board

the output is only '....' and not a board like i expected.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  	char array[10][10];

	for (int x = 0; x <4; x++) {
		for (int y = 0; y <4; y++)
			array[x][y] = '.';
		}
	for (int i = 0; i < 4; ++i)
	{
		for (int j = 0; j <4; ++j)
		{
			cout << array[i][j];
		}
		cout << '\n';
	}

	cout << endl;
What do you expect ?
You set the first 4 rows and cols to '.' and that exactly what you get out.
it printed out a board when i ran it online here http://cpp.sh/46kag

what were you expecting? hopefully 4 rows of 4 dots :)


1
2
3
4
....
....
....
....
My compiler was printing out in a weird way. it works.
Topic archived. No new replies allowed.