SEG FAULT in PALIN on codechef and spoj

I am attempting next palindrome http://www.codechef.com/problems/PALIN on Codechef and Spoj but the approach is always recieving SIGSEGV although the same approach is getting AC for a similar question
http://www.codechef.com/problems/NXTPALIN I dont’t think I am accessing any illegal memory cell nor I am trying to allocate too much memory my approach on NEXTPALIN that got AC here The similar approach that got a SIG-SEGV on PALIN here any help would be deeply appreciated Thanks in Advance :slight_smile:

At the first glance at your code I saw that you declared a character array ‘str’ of size 100000, while maximum input size given in the problem is 1000000(one extra 0 :wink: ).

char str[100000];
1 Like

@snk967 Thank you very much got AC now i should have been careful :stuck_out_tongue: my bad anyways thanks again