On 2008-02-18 17:41, Tim Daneliuk <[EMAIL PROTECTED]> wrote:
> Tim Daneliuk wrote:
>> Ooops ... wasn't paying attention.  While the printed output is the
>> same, doing it this way is destructive to the original s1 string -
>> which may matter (or not)...
> 
> So, to protect the original string, you do have to copy the original
> string to a new buffer:

... or use strcspn() and strspn() which are non-destructive
(see my other post in the same thread about an example).

I tend to prefer avoiding strtok() if possible, precisely because
of its destructive behavior.

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to