Code:
// Create display function to make 2D array
char createdisplay()
{
char X = 'X';
char bb[7][7] = {{0, 1, 2, 3, 4, 5, 6}, {1, X, X, X, X, X, X}, {2, X, X, X, X, X, X}, {3, X, X, X, X, X, X}, {4, X, X, X, X, X, X}, {5, X, X, X, X, X, X}, {6, X, X, X, X, X, X}};
return bb[7][7];
}
// Display a blank board using char bb[7][7]
void DisArray(char bb[7][7])
{
for (char x=0; x < 7; x++) {
for (char y=0; y < 7; y++)
cout << bb[x][y] << endl;
}
return;
}
now this compiles with a warning about the local variable bb. when i run it i get like 30 lines with just "[" in it and then it ends. whats wrong with my code? whats the correct code to display what i was trying to do? thanks in advance