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: Michael Terry
Subject: Re: [Beaver-devel] str_replace_tokens
Date: Fri, 06 Jun 2003 17:11:36 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030322

Leslie Polzer 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 *.

No, you couldn't. C passes things by value, so if you did it with one *, you would merely get a copy of the calling function's pointer. You wouldn't be able to change the actual calling function's pointer.

Think of it like this: if you wanted to actually change the value of an int, you would use int *. Since we want to change the value of a gchar *, we use gchar **.

-mt

Attachment: pgptKxTDd3pNs.pgp
Description: PGP signature


reply via email to

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