I am having a compiling issue because of some syntax errors while trying to return an array. You can probably ignore most of the code below; I am only concerned with the call and return of the CreateBoard[][] array. As I understand a pointer might be necessary to do this. Does anyone have some tips that I can use?
int main()
{
int Board[9][9];
Board = CreateBoard();
int difficulty = Difficulty();
WriteFile(Board);
Display(Board);
system ("pause");
return 0;
}
int CreateBoard()
{
int row = 0;
int column = 0;
bool BoardStatus [9][9];
int Board [9][9]; // Creates the Sudoku board
int BoardTemp;
Reset(Board, BoardStatus);
for (row = 0; row <= 8; row++)
{
for (column = 0; column <= 8; column++)
{
while (BoardStatus [row][column] == false)
{
if (Board [row][column] == -1)
{
Board [row][column] = Random_Number(); // a random number is placed inside every cell before the validation process begins in order to randomize each puzzle.
BoardTemp = Board [row][column];
}
BoardStatus [row][column] = Verify(Board, row, column);
if (BoardStatus [row][column] == false)
{
Board [row][column] = Board[row][column]+ 1;
if (Board [row][column] == 10) // A value inside a cell cannot be greater than 9.
{
Board[row][column] = 1;
}
if (BoardTemp == Board[row][column] )
{
Reset(Board, BoardStatus);
row = 0;
column = 0;
}
}
}
}
}
return Board;
}