I have been working to solve this for hours now. I am looking to use a recursive function to solve a maze that is given by the user input. The structure of the maze looks like this:

```
##########          
#  ###   #
#  #     #
#        #
#    o   #
#        #
##########   

        bool searchMaze(int currR, int currC)
        if (currR > (rows-1) || currC > (columns-1) || currR < 0 || currC < 0)
            return false;
        if (maze[currR][currC] == "o")
            return true;
        if (maze[currR][currC] == "#")
            return false;
        maze[currR][currC] = "+";

        if (searchMaze((currR - 1), currC) == true)
        {
            return true;
        }
        if (searchMaze(currR, (currC + 1)) == true)
        {
            return true;
        }

        if (searchMaze((currR + 1), currC) == true)
        {
            return true;
        }
        if (searchMaze(currR, (currC - 1)) == true)
        {
            return true;
        }
        maze[currR][currC] = " ";
        return false;
    }

```

This is my recursive method above and the "o" marks a solution. Every time I run the program I am facing an infinite recursion and get the error 

> 
> "Exception thrown at 0x002396DA in projectName.exe: 0xC0000005: Access
>  violation writing location 0x000A0FFC" and "Unhandled exception at
>  0x002396DA in projectName.exe: 0xC0000005: Access violation writing
>  location 0x000A0FFC."
> 
> 
>