beaver-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Beaver-devel] str_replace_tokens


From: Leslie Polzer
Subject: Re: [Beaver-devel] str_replace_tokens
Date: Fri, 6 Jun 2003 22:58:29 +0200

On Fri, 06 Jun 2003 16:08:51 -0400
Michael Terry <address@hidden> wrote:

> The reason is so that I can write
> str_replace_tokens (&str, 'l', "hi");
> 
> instead of
> str = str_replace_tokens (str, 'l', "hi");
Huh? But it'd be possible alright to write

        str_replace_tokens (str, 'l', "hi");

too, wouldn't it?
Of course only if the ** was a *.


> That's all, to my knowledge.  Since the function actually realloc's the 
> string, you would never assign the return to anything but the same pointer.
> 
> Of course, then the question is why realloc instead of malloc.  I knew 
> how I was going to use the function, and I knew that it would be simpler 
> for me if I realloc'ed (because otherwise I would have to free the old 
> string, which I never care about anyway).
I am not concerned in any way about operating directly on the string
and not taking a copy.
My point is just the thing with the double pointer indirection.

Leslie

-- 
Current Main System: LFS Linux dreadnought 2.4.20 #18 Thu May 15 19:11:10 CEST 
2003 i686
Random Religious Statement: Eterm is the most beautiful terminal emulator there 
is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]