How to remove Runtime SIGTSTP error ?

I wrote the following programme which will store the occurrence of every letter of a string in an array and upon seeing a letter repeated , it will take the data from previous element of array.

Here is the code.

On running it on different ide, some are showing segmentation fault or SIGTSTP error. Can anyone please tell me what is the error ?

2 Likes

Segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access(eg: reading array elements over its limit )
Look at the constraints on inputs and then typecast the variables according to contraints.

2 Likes

It’s not segmentation fault seg fault it SIGSEGV
This one is when your code gets suspended due to illegal operation like decrementing an unsigned variable beyond zero, etc

3 Likes

hlo bro can you give your any socail media id

try using

#include< stdio.h>

module
and use scanf for input values

why is this code showing SIGTSTP…code
thanks!