I have change two condtiions first checking in the current cell is not zero and then if j==n how this is going to effect
Order of stament in sudo-solver
hello @Vikaspal
this might cause segmentation fault.
because if matrix size is m X n then u can access index upto (m-1,n-1.)
but in ur code u will be accessing (row,n) which will cause seg fault because n is not a valid index.
so interchange the position of these two conditions
@aman212yadav got it can i know how to pass the n variable to my 2D matrix
sudokuSolver(maze, 0, 0, n); // funtion call
bool sudokuSolver(int maze[][n], int i, int j, int n) // here in maze[][n] n is not declare how to pass n here
no u cannot pass it like this.
declare ur 2 d array dynamically .
and then u can pass that array as pointer without mentioning any size.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.