So I'm trying to write a program to simulate Conway's game of life. I thought it'd be cool to declare a class called Cell and use an array of objects instead of an array of ints or bools. My problem is that when I go to compile a function to which I pass a multi-dimensional array of Cell, the compiler yells at me for not giving it a set size. (The size of my board varies). My code...
void printBoard(Cell board[][], int rows, int cols)
{
system("cls");
for(int i=0; i<rows; i++)
{
...
}
With a little tinkering and browsing of samples on the internet, I noticed that making it a single dimensional array of ambiguous size works just fine, but soon as its more than one dimension, it says I must declare bounds.
I suspect there may be a way to work around this with pointers, but haven't figured it out yet. Suggestions?