title: display multiple errors via bool flag c++
body: <p>Been a long night, but stuck on this and now am getting "segmentation fault" in my compiler..</p>
  
  <p>Basically I'm trying to display all the errors (the cout) needed. If there is more than one error, I am to display all of them.</p>
  
  <pre><code>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&lt;9;index++)
          if(board[x][index].number==value){
              cout&lt;&lt;"That value is in conflict in this row\n";
              moveError=false;
              }
  
      for(index=0;index&lt;9;index++)
          if(board[index][y].number==value){
              cout&lt;&lt;"That value is in conflict in this column\n";
              moveError=false;    
              }
  
  
  
      for(int i=v_subgrid*3;i&lt;(v_subgrid*3 +3);i++){
          for(int j=h_subgrid*3;j&lt;(h_subgrid*3+3);j++){
              if(board[i][j].number==value){
                  cout&lt;&lt;"That value is in conflict in this subgrid\n";            
                  moveError=false;
              }           
          }
      }
  return true;
  }
  </code></pre>