긴 밤 있었지만이 붙어 지금 내 컴파일러에서 "분할 오류".. 기본적으로 표시 여러 오류
나는 모든 오류를 표시하기 위해 노력하고있어
합니다 (COUT)를 얻고 필요합니다. 둘 이상의 오류가있는 경우 모두 표시해야합니다.bool validMove(const Square board[BOARD_SIZE][BOARD_SIZE],
int x, int y, int value)
{
int index;
bool moveError = true;
const int row_conflict(0), column_conflict(1), grid_conflict(2);
int v_subgrid=x/3;
int h_subgrid=y/3;
getCoords(x,y);
for(index=0;index<9;index++)
if(board[x][index].number==value){
cout<<"That value is in conflict in this row\n";
moveError=false;
}
for(index=0;index<9;index++)
if(board[index][y].number==value){
cout<<"That value is in conflict in this column\n";
moveError=false;
}
for(int i=v_subgrid*3;i<(v_subgrid*3 +3);i++){
for(int j=h_subgrid*3;j<(h_subgrid*3+3);j++){
if(board[i][j].number==value){
cout<<"That value is in conflict in this subgrid\n";
moveError=false;
}
}
}
return true;
}
분할 오류? 재부팅 해보십시오 *. (사과를 Dilbert에게) – EFraim
@igor : KennyTM의 포맷 변경이 롤백 된 이유는 무엇입니까? 이전에 롤백 한 것을 알기 전에 가독성을 높이기 위해 동일한 변경을하려고했습니다. –
모든 인덱스가 유효합니까? 여기에는 오류 검사가 없습니다. – Naveen