Hi. Sorry to bother you guys with this newbie problem I'm having. I'm trying to learn C by trying to create a tic-tac-toe game. This is my code so far:
The problem is that the compiler complains about "invalid use of array with unspecified bounds". I do not know how to fix the compiler errors. Can anyone show me what I'm doing wrong?Code:#include <stdio.h> #define ROWS 3 #define COLUMNS 3 void initialize_board(void); void test(void); int board[ROWS][COLUMNS]; int main() { initialize_board(); test(); return 0; } void initialize_board(void) { int i, j; extern int board[][]; for (i = 0; i < ROWS; ++i) for (j = 0; j < COLUMNS; ++j) board[i][j] = 0; // compiler error here! } void test(void) { int i, j; extern int board[][]; for (i = 0; i < ROWS; ++i) for (j = 0; j < COLUMNS; ++j) printf("board[%d][%d] = %d", i, j, board[i][j]); // compiler error here! }