Can't find the reason for SIGSEGV

I’m trying to solve this simple SPOJ problem http://www.spoj.com/problems/MICEMAZE/ .
This is my current solution http://ideone.com/M2MUlb .
It’s giving me SIGSEGV runtime error at the 7th test case. I don’t think my code is going out of bounds of memory anywhere. Can somebody please help me out?

1 Like

Just saying, I found what the reason was. I assumed the graph was going to be connected which is not true. This was causing a problem. It’s fixed now.

1 Like

thanks @pale_rider , saved me from frustation :slight_smile:

there is chances of array bound , memory limit exceed .
See questions input constraints carefully.

//