Hello, I have recently been trying to make a new program making multidimensional arrays! Here is my code:
I get the error: Excess elements in scalar initializer on line 12 on the X.
Could anybody help?
#include <iostream>
using namespace std;
int main()
{
const int MAX_ROWS = 3;
const int MAX_COLUMNS = 3;
char table [MAX_ROWS][MAX_COLUMNS] = {
{ {'O', 'X', 'O'},
{'O', 'X', 'X'},
{'X', 'O', 'X'} }
};
for (int i = 0;i<MAX_ROWS;i++){
for (int j = 0; j<MAX_COLUMNS;j++) {
cout << table[i][j];
}
cout << endl;
}
return 0;
}
I get the error: Excess elements in scalar initializer on line 12 on the X.
Could anybody help?