[try Beta version]
Not logged in

 
Printing board

Sep 28, 2018 at 4:12am
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;
Sep 28, 2018 at 6:55am
What do you expect ?
You set the first 4 rows and cols to '.' and that exactly what you get out.
Sep 28, 2018 at 9:39am
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
....
....
....
....
Sep 29, 2018 at 11:17pm
My compiler was printing out in a weird way. it works.
Topic archived. No new replies allowed.