The 2D array is a good idea. You could make each element a bitfield. Say:

Code:

#define W_EAST 0x1
#define W_SOUTH 0x2
#define W_WEST 0x4
#define W_NORTH 0x8
#define CHECKED 0x10

Then, while reading the text file you just do **array[row][column] = input_num;**

Then start at the starting coordinates and move in all the possible directions. Something like:

Code:

void function(int cur_row, int cur_column)
{
array[cur_row][cur_column] |= CHECKED;
if(!(array[cur_row][cur_column] & N_WALL) && !(array[cur_row - 1][cur_column] & CHECKED))
function(cur_row - 1, cur_column);
/* Same if(), but for the other 3 directions */
}

Do that for each direction and if the if() matches then call the function again recursively on the new row/column.

Then you also just need to check if the cur_row and cur_column match the destination coordinates.

Note: The CHECKED bit is only necessary if your maze can have more than one way to get to the same coordinate.