What is a segmentation error?


my code is showing segmentation error on codechef but running on coding blocks ide.
what should i do?

Hey!
There can be many reasons because of which the segmentation error occurs, for some test case:
may be your program is trying to access memory that it’s not allowed to access, it can also occur if your program is trying to dereference a nul ptr. Also online judges generally have a limited allowable memory, if you try to access too much memory then it can lead to Seg error as well.

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.