sudoku slover problem

I working on a Sudoku assignment and I am stuck. I have tried changing everything I think possible to get it to work but now results.

CAN ANYONE HELP!!!!!!!!!!!!!!!!!!!!!!!!!!! please

the errors I am getting are

-
Last edited on
In sudoku.cpp, you don't have a closing brace for the void sudoku_board(int board[]) function.

1
2
3
4
5
6
7
8
9
10
11
void sudoku_board(int board[])
{

//int board[9][9];
int row[9]; // forbidden row
int col[9]; // forbidden column
int block[9]; // forbidden block
} // This one right here

int solve(int pos)
...
You are attempting to define the function solve() within the sudoku_board() function. C++ does not permit nested function definitions.
^^^What he said^^^
Thanks let me try that I see what Happens
After dong that I got the following errors


-bash-3.2$ g++ *.cpp -I/usr/local/include -L/usr/local/lib -lcppunit -ldl -g
sudoku.cpp: In function âint solve(int)â:
sudoku.cpp:23: error: ârowâ was not declared in this scope
sudoku.cpp:23: error: âcolâ was not declared in this scope
sudoku.cpp:23: error: âblockâ was not declared in this scope
sudoku.cpp:26: error: âboardâ was not declared in this scope
sudoku.cpp:30: error: ârowâ was not declared in this scope
sudoku.cpp:31: error: âcolâ was not declared in this scope
sudoku.cpp:32: error: âblockâ was not declared in this scope
sudoku.cpp:42: error: âboardâ was not declared in this scope
sudoku.cpp:48: error: ârowâ was not declared in this scope
sudoku.cpp:49: error: âcolâ was not declared in this scope
sudoku.cpp:50: error: âblockâ was not declared in this scope
sudoku.cpp:53: error: ârowâ was not declared in this scope
sudoku.cpp:54: error: âcolâ was not declared in this scope
sudoku.cpp:55: error: âblockâ was not declared in this scope
sudoku.cpp:57: error: âboardâ was not declared in this scope
sudoku.cpp: At global scope:
sudoku.cpp:69: error: expected declaration before â}â token
-bash-3.2$
Topic archived. No new replies allowed.