what's wrong with this code?

const int ROWS = 2;
const int COLUMNS = 3;
char board[COLUMNS][ROWS] = {{'0','X', '0'},
{' ', 'X', 'X'}};
Switch the COLUMNS and ROW. What you have now, is declaring 3 rows of 2, but need 2 rows of 3.

use
1
2
char board[ROWS][COLUMNS] = {{'0','X', '0'},
{' ', 'X', 'X'}}; 

or change to
1
2
const int ROWS = 3;
const int COLUMNS = 2;

Thank you for you're help! I gratefully appreciate it :)
Topic archived. No new replies allowed.