title: Stuck in Infinite Recursion
body: <p>I have this function to solve a maze in C++, but when I run the program I get a Bad Access Error in the recursion. I think in may be an infinite loop. I have no idea where and what is going wrong.</p>
  
  <pre><code>bool Solve_Maze(int coorx,int coory) {
      if((Map[coorx][coory]==Start)||(Map[coorx][coory]==path)) {
          Map[coorx][coory]=wall;
          Solve_Maze(coorx+1,coory);
          Solve_Maze(coorx-1,coory);
          Solve_Maze(coorx,coory+1);
          Solve_Maze(coorx,coory-1);
      }else if(Map[coorx][coory]==End) {
          cout&lt;&lt;"You Solved the Maze!"&lt;&lt;endl;
          delete Map;
          return(true);
      }
  }
  </code></pre>