I'm making a program to solve sudokus. I'm trying to make an multidimensional array to hold the row, column, and 0s and 1s to indicate if certain values are possible.
ie board[0][0][3] = 1 indicates that a 3 is possible in square A1
ie board[0][0][0] = 3 indicates that the value of A1 is 3
I'm trying to initialize the array with all 1s for the possibilities, then they'll change to zeros later as possibilities are ruled out. Every time I test this though, I get a segmentation fault. what is wrong with it?
1 2 3 4 5 6 7
void getPossible(int board[9][9][10])
{
for(int r = 0; r < 9; r++) // every row
for (int c = 0; c < 9; c++) // every column
for (int i = 1; i < 10; i++) // every possibility
board[r][c][i] = 1;
}