This code is giving me the error "expected primary-expression before ']' token." After googling and looking around Daniweb I still cannot find what this means. Can anyone enlighten me?

int board[*width][*height];
          if(OpenBoard(boardName, width, height, board[][*height]))
          {
                
          }

//...
//function definition...

bool OpenBoard(std::string *boardFileName, int *width, int *height, int board[][100])

You can't declare arrays using sizes available at run-time.

Given that your function definition has a constant, how about

int board[100][100];
          if(OpenBoard(boardName, width, height, board))
          {
                
          }

//...
//function definition...

bool OpenBoard(std::string *boardFileName, int *width, int *height, int board[][100])

But since this is C++, how about std::vector< std::vector<int> > board;

Well i dont think arrays can be initialised with variables.

i think vectors are the suitable task for the job.

Thanks guys I really appreciate it! I've been puzzled for a few hours haha

Comments
You're welcome :)
This question has already been answered. Start a new discussion instead.