Displaying a 2d array on console problems

Soo...I'm stuck. I keep getting silly errors(commented on function), only in the function itself. Not sure why... I don't know why it is saying it's a constant char in the first place.

prototype:
void displayBoard(int board[][8]);

called from int main():
1
2
3
4
5
6
7
int main()
{
	int board[8][8];
	//findEmpty(board);
	//placeQueen(board);
	displayBoard(board);
}


function
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
void displayBoard(int board[][8])
{
	char show = " "; //error C2440: 'initializing' : cannot convert from 'const char [2]' to 'char'
	for(int i = 0; i < 8; i++)
	{
		cout << endl;
		for(int j = 0; j < 8; j++)
		{
			switch(board[i][j])
			{
			case 0:
				show = "e";//error C2440: '=' : cannot convert from 'const char [2]' to 'char'
				break;
			case 1:
				show = "Q"; //same as before
				break;
			case 2:
				show = "X";//same as before
				break;
			}

			cout << " " << show << " ";
		}
	}
}
Line 3: char show = ' ' ;

Line 12: show = 'e' ;

line 15: show = 'Q' ;

... "this is a string, not a character"

Haha I knew it was a simple thing :D Thank you kindly! :)
Topic archived. No new replies allowed.