code ran into segmentation fault error.how to fix? [closed]

in the for-loop line 24, the condition is set to i < (i+m). If m is a positive integer, than the condition will always be true, therefore s[i] will at some point access memory that it shouldn’t.

Leave a Comment