Mail Archives: djgpp/2001/09/29/02:05:27
What ever happened to the earlier comment...
<start_quote>
anyway, i think this is going to be my last post on the topic.
sinan.
--
--------------------------------
A. Sinan Unur
http://www.unur.com/
<end_quote>
On 29 Sep 2001 01:00:32 GMT, "A. Sinan Unur" <asu1 AT cornell DOT edu> wrote:
>CBFalconer <cbfalconer AT yahoo DOT com> wrote in
>news:3BB50884 DOT 347A4384 AT yahoo DOT com:
>
>> Thank you. I knew there was a reason I made my equivalent
>> (revstring) a void function. I just didn't know what it was :-)
>
>The usefulness of a strrev function depends very much on what you intend to
>use it for. For example, if your program is looking for palindromes, you
>might want to use something like:
>
>strcmp(word, strrev(word));
>
>i which case the in-place nature of the proposed function is really not
>helpful. on the other hand, if one wants to use strrev this way, there are
>other issues such as: where did the string returned by strrev come from
>(similar to strdup). if the memory was allocated dynamically, the caller
>needs to remember to free it. can strrev return NULL? if it is allocated
>statically, the function is not thread-safe so on and so forth.
>
>the proposed in-place strrev would address a very narrow issue, and provide
>a solution to only a very small number of problems. hence, my belief that
>it is better for programmers to implement their specific solution.
>
>Of course, it is only my opinion.
>
>Sinan.
- Raw text -