Multi dimensional arrays of int and char type

Nov 11, 2012 at 1:10am
i'm making a reversi game board with and and int array of NxN,
i initialized the array as 0 but i'm wondering is there a way to replace the 0
with a character such as "W"? i tried that but it gave me an error of course.
Last edited on Nov 11, 2012 at 1:11am
Nov 11, 2012 at 1:15am
Btw, this is the function template i HAVE to use.

bool DisplayBoard(int reversiBoard[MAX_ARRAY_SIZE][MAX_ARRAY_SIZE],
int numRowsinBoard)

you see, if it was char, then i wouldn't have this problem.
Last edited on Nov 11, 2012 at 1:15am
Nov 11, 2012 at 1:16am
You could have the array be type char since the numbers 0-9 can be represented as chars as well as letters and symbols. To decided what it displays just say char[N][N] = 'A'. Replace the A with whatever you want to.
Nov 11, 2012 at 1:21am
i think you wrote it before you read my second post :)
Topic archived. No new replies allowed.