I have checked to ensure that the data file was correctly read into maze.Code:int find_path(char maze[][8],int x, int y); int main(int argc, const char * argv[]) { int x = 0; int y = 0; char maze[8][8]; FILE *fp; fp = fopen ("maze3.txt","r"); if(fp == NULL) printf("File unreadable."); for (int i=0; i<=7;i++) { printf("\n"); for( int j = 0; j<=7;j++) { fscanf(fp," %c",&maze[i][j]); } // 8x8 array processed into maze } // process data file into array find_path(maze,x,y); return 0; } // end main int find_path(char maze[][8],int x, int y) { if(x>6) { exit(1); }//exit condition for recursion printf("%c",find_path(maze,x+1,y)); // never prints anything why? return 0; }
When i use recursion to print out the rows (x) in find_path it never prints out anything.