So I'm working on a "simple" sudoku solving program in C++ and i ended up having a 6-nested loop in the array and I keep hitting a STATUS_ACCESS_VIOLATION. i'm wondering if i have too many loops and the program just crashes? ill explain the code as best I can if you would like me to, but its hopefully not too confusing...
Code:for ( int c = 0; c < 9; c++ ) { if ( !complete[c] ) { for ( int r = 0; r < 9; r++ ) { if ( board[r][c][0] == '_' ) { //if the square is still undefined length = strlen(board[r][c]); //find the length of the char array bool instring = false; int index = 0; for ( int col = 0; col < 9; col++ ) { for ( int ro = 0; ro < 9; ro++ ) { if ( counter[ro][col] != '_' ) { cout<<true; //see if the char in counter is in the string for ( int g = 1; g < length; g++ ) { if ( board[r][c][g] == counter[ro][col] ) { index = g; while ( index < length ) { board[r][c][index] = board[r][c][index+1]; index++; } } } } } } } } } }



LinkBack URL
About LinkBacks


