I am writing a Conway's Game of Life in C++. I get a compile time error having something to do with the way I am passing 2-d arrays to methods:
gameoflife.cpp:5:25: error: array has incomplete element type 'int []'
void print_game(int game[][], int SIZE);
gameoflife.cpp:6:23: error: array has incomplete element type 'int []'
void run_game(int game[][], int SIZE);
gameoflife.cpp:7:23: error: array has incomplete element type 'int []'
void set_cell(int game[][], int i, int j, int next[][], int SIZE);
etc.
The beginning of my code is:
void print_game(int game[][], int SIZE);
void run_game(int game[][], int SIZE);
void set_cell(int game[][], int i, int j, int next[][], int SIZE);
Evidently the problem begins here.
What is the issue with passing a 2-d array in a method? Should I use a ** instead?