The Love-Letter Mystery

  • + 0 comments

    your code is giving a segmentation fault.

    for this input

    5
    pue
    heubsbn
    feazhaxpux
    hmhcy
    tmp
    

    Try doing this in your local machine.

    gcc -pipe -O1 -std=c99 code.c 
    gdb a.out 
    run < input01.txt
    

    it gives the error

    Program received signal SIGSEGV, Segmentation fault.
    0x00000000004007db in change (z=112 'p', z@entry=<error reading variable: DWARF-2 expression error: Loop detected (257).>, c=97 'a', i=2, 
    i@entry=<error reading variable: DWARF-2 expression error: Loop detected (257).>) at soln.c:45
    45    change(z,c,i);