My code is giving segmentation fault. Why?

add one extra condition

   if(maze[i][j]=='1')return false;

Modified Code

why you have added this condition?

if you have already pass from a cell (marked it as 1) and you come again through some different path to that cell then it means you are in cycle
and if you don’t return then you will stuck in cycle and segmentation fault occur

Can you tell me proper meaning of segmentation fault? Why it occurs?

it is basically a runtime error
segmentation fault occurs when you stuck in a infinite loop
or you try to access other’s memory which is not allocated to you