gnupic: Re: [gnupic] gpasm memory leaks
Subject:
Re: [gnupic] gpasm memory leaks
From:
David ####@####.####
Date:
1 Jun 2007 03:18:21 +0100
Message-Id: <20070531211220.2a683ce9@DEEPTHOUGHT.BARNET.net>
On Thu, 31 May 2007 18:24:48 -0700
Jeff ####@####.#### wrote:
> On Thu May 31 2007 15:32, David Barnett wrote:
> > I had a real
> > headache when I finished with all the changes and learned that C
> > doesn't directly support pass-by-reference =(.
> >
> calledFunction(&referencedData);
>
> Did I misunderstand your statement?
Yep. I mean declare the parameter type (in the function prototype) to be
a reference instead of a pointer. You can get almost the same effect
the way you have above, but if you switch from one to the other, you
have to go through and add or remove a '*' or '&' on each access of
that parameter (or worse, hunt down '.' and '->'). It's not really
worth all this discussion, it was just a gripe that it sucked and also
I was surprised I didn't already know.
David Barnett