segmentation error in compiler and parsers

my code is giving correct output on ideone but when submitting here it says Runtime error(SIGSEGV)…please can anyone help!

It is happening because you might be accessing some part of memory which is not available to you.

For example, you may be accessing some element of array which is actually not there.

Suppose you have declared an array a[100]
and you are trying to access element a[101] in your program.