Hi guys, girls
I've recently begun teaching myself programming in order to gain a head start for when I begin University next year. After much procrastination about which language to begin with, and many people informing me that the language didn't matter, I chose C.
Since then I've been following the lectures by Richard Buckland (which can be found on iTunes U under COMP1917). As part of an assignment, the students at the time were tasked with writing a set of functions to complete a Sudoku Solver. Taking on this assignment myself, I've come across a small problem I'm having trouble understanding.
I'm currently writing a function to print the solved Sudoku puzzle. For the most part there's nothing too challenging, however I keep receiving the error
on the line where I print out the value.
I've included the function below in order to help gain a better perspective of what I'm doing.
Thanks,
- John
P.S ~ As a side note, if anybody has any material, lectures or books they'd recommend a beginner to aid in my learning of programming concepts or C, I'd be most grateful to receive them.
Thanks again
- John
I've recently begun teaching myself programming in order to gain a head start for when I begin University next year. After much procrastination about which language to begin with, and many people informing me that the language didn't matter, I chose C.
Since then I've been following the lectures by Richard Buckland (which can be found on iTunes U under COMP1917). As part of an assignment, the students at the time were tasked with writing a set of functions to complete a Sudoku Solver. Taking on this assignment myself, I've come across a small problem I'm having trouble understanding.
I'm currently writing a function to print the solved Sudoku puzzle. For the most part there's nothing too challenging, however I keep receiving the error
Code:
Array subscript is not an integer
I've included the function below in order to help gain a better perspective of what I'm doing.
Code:
void showGame (sudokuGrid game) {
double count;
count = 0;
// Step through the array, print each entry in the array
while (count <= GRID_SIZE) {
printf ("%c ", game[count]);
// If count is divisible by 9, print a newline
if (count - (count - 9) / 9 == 1) {
printf ("\n");
}
count++;
}
}
Thanks,
- John
P.S ~ As a side note, if anybody has any material, lectures or books they'd recommend a beginner to aid in my learning of programming concepts or C, I'd be most grateful to receive them.
Thanks again
- John