Advertisement

How do I remove elements in an array?

Started by May 24, 2001 09:24 AM
10 comments, last by Zeke 23 years, 8 months ago
Actually, that is a fair point... I dont think it will be a problem in the majority of cases though, unless you were removing a word that was negative in length (which is just silly). I think strcpy just does a byte for byte copy, so it is pretty safe.

If it makes you happier, stick this line in my function before the strcpy:

*ptr = 0;

Now the two strings dont overlap any more.
True dat. You can use strlen and memmove to accomplish this safely.

This topic is closed to new replies.

Advertisement