arrays with ints and chars

i've been asked to make make a game and it includes printing
game board as nxn array and upon user input it needs to reveal a "card"
on the first input and another card on the other.if the cards match you keep them
on screen and if not-revert to original game board which is mainly a
square printed with "*"'s.

my first logic was to create a function for int array and then to create another one for char array like something similar to this:
body of the char array(assume N is 4)-


void starrymess(){

for(int i=0;i<N;i++)
{
char star='*';

for(int p=0;p<N;p++)
{
game[i][p]=star;
}
}

}

and then to print this i use

void gmscreen()
{
for(int i=0;i<N;i++)
{
static int z=1;
while(z==1)
{
cout << " 1 2 3 4" << endl << " ----------" << endl;
z++;
}
cout << i+1 << "|";
for(int p=0;p<N;p++)
{
cout << setw(3) << game[i][p];
}
cout << endl ;

}

then i compare this game[][] to another array with numbers in it and if they match keep them and if not i discard given values.problem is i failed to do any type of conversion and i have no idea as to how go on with this problem.any help?
Last edited on
Topic archived. No new replies allowed.