Trying to pass a 2d array (gameBoard) form main to initialiseBoard but keep getting ' error C2059: syntax error : ']' ' here's a cut down version of my code below
Any help would be appreciated
const int BOARDWIDTH =5;
const int BOARDhEIGHT =5;
void initialiseBoard(bool gameBoard[][BOARDHEIGHT],const int BOARDWIDTH)
{
for (int y=BOARDHEIGHT-1;y>-1;y--)
{
for (int x=0;x<BOARDWIDTH;x++)
{
//set each square to 'occupied' (true)
gameBoard [x] [y] = true;
}//end of for loop
}//end of for loop
}
int main()
{
bool gameBoard [BOARDWIDTH] [BOARDHEIGHT];
//start game
//initialise the board
initialiseBoard(gameBoard[][BOARDHEIGHT],BOARDWIDTH);
}