this line: if (factor!=0) s1[c1]=s1[c1+factor]; tries to see behind the s1's end after the index (length_of_s1 - factor) is reached. this causes SIGSEG it's not nice to ask people to debug your own homework :))))))
bye -=O0~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~O0=- "Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!" [L.Carrol "Jabberwacky"] On Sun, 25 Nov 2001, Eugene Romm wrote: > Hello. > > I've written a procedure that's supposed to remove all occurances of > string2 from string1 (parameters). > For reasons I do not understand, the program compiles but segfaults when > run from the command prompt, but silently executes without a warning > when run under GDB. Attached is the program. Segfault occurs on line 29, > as far as I can tell. > ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]