Shortest path between two points in a grid ( matrix )

I am not able to debug my code . Please help.
Link : https://ide.codingblocks.com/s/86673

actually you are going only in two directions up and down.
you need to go in all four directions i.e.
dx[]={ 1, -1, 0, 0 }
dy[]={ 0 , 0 , 1 , -1}

If i go in all 4 directions then it is giving an infinite loop ( recursive function is being called over and over again )

mark them as visited if you visit them once , and then dont visit them again

also send me the link to the question

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.