malloc, structures, arrays and sudoku!!
Hi everyone,
A while ago i wrote a program to solve a sudoku board by way of learning to program in C. It worked and i learned a lot (and caught the bug!)
Now i'm looking at improving it.
The original program was to solve a 9x9 board. But i'd like to modify it so the user inputs the board size.
So i'd have an array: board[width][width][9]
Can anyone suggest the best way to go about this?
Will i have to use malloc()?
Firstly should i have it as a structure?
like
Code:
struct board {
int array[width][width][9]
};
Or is there no advantage in having a structure with only one variable type?
Thanks in advance,
Kai.