could some one give me a quick example on how to use arrays to print out a simple 2d grid
\
thanx
Printable View
could some one give me a quick example on how to use arrays to print out a simple 2d grid
\
thanx
I did a tic tac toe program that had the array char board[3][3].
to print it out, i went like this:
cout<<board[1][1]<<" "<<board[1][2]<<" "<<board[1][3]<<endl;
cout<<board[2][1]<<" "<<board[2][2]<<" "<<board[2][3]<<endl;
cout<<board[3][1]<<" "<<board[3][2]<<" "<<board[3][3]<<endl;
the first number is the row, the second is the column.
ok thanx.
but how do i move a object on it such as the letter 'X' around the board using the arrow keys or could you tell me were i could find a good tutorial on that sorta stuff
thanx
cout<<board[1][1]<<" "<<board[1][2]<<" "<<board[1][3]<<endl; (<- this part is continued)
could some one tell me were the parse error is befor the '<'