Hello forum I have been stuck on creating a c++ project that creates a complete sudoku from blank.
I work with an array with 81 indexes, it starts in the upper leftcorner with 0 and ends in the lower rightcorner with 80. The array contains characters instead of integers.
EDIT : I deleted my code because it tried solving the sudoku the wrong way.
I compiled your code. I paid attention to the warnings the compiler generated:
warning C4715: 'getBlock' : not all control paths return a value
warning C4715: 'fillField' : not all control paths return a value
I placed a line at the end of each function that generated some output when each of those functions didn't return a value.
As it turns out, getBlock always returned a value, but fillField did not. The line of code I inserted at the end of fillField was:
std::cout << "ERROR: fillField failed to return a value - index = " << index << '\n' ;
The resulting output was (non-error messages elided for brevity):
ERROR: fillField failed to return a value - index = 15
ERROR: fillField failed to return a value - index = 16
ERROR: fillField failed to return a value - index = 17
ERROR: fillField failed to return a value - index = 21
ERROR: fillField failed to return a value - index = 22
ERROR: fillField failed to return a value - index = 23
ERROR: fillField failed to return a value - index = 35
ERROR: fillField failed to return a value - index = 43
ERROR: fillField failed to return a value - index = 44
ERROR: fillField failed to return a value - index = 47
ERROR: fillField failed to return a value - index = 49
ERROR: fillField failed to return a value - index = 50
ERROR: fillField failed to return a value - index = 60
ERROR: fillField failed to return a value - index = 69
ERROR: fillField failed to return a value - index = 70
ERROR: fillField failed to return a value - index = 73
ERROR: fillField failed to return a value - index = 76
ERROR: fillField failed to return a value - index = 77