made a similar program, cause i was bored.
Heres best i can tell you. load the maze int othe array like you have been. when doing this find your start and end points, store them somewere.
NOw as said use recursion.
as an example
this is assuming x is a wall o is a empty spot
using F as the finished spot locator
the 2d array is built as havign top right corner of the map as 0,0
Code:
void search(int x, int y, unsigned char dir) { // x y coords to check and direction you are coming from
if map[x][y] = 120 { // 120 is ascii code for x
return;
}
if map[x][y] = 111 { // 111 is ascii code for o
// check up
search(x, y - 1, d);
// check down
search(x, y + 1, u);
// check left
search(x -1, y, r);
//check right
search(x+1, y, l);
// if you get here then all suround spots are xs
return
}
Ok a note about this code
its just an idea
your gona need to use loc to make sure your not checking the direction you were just coming from.
gona let you figure otu rest if yo uened help post some code.