Re: Passing by reference

From: Leonardo Herrera (leonardo.herrera@mercantil.com)
Date: 03/14/01


George Greer wrote:
> On Tue, 13 Mar 2001, Patrick Dughi wrote:
>
> >      Uhm.. Passing by reference is a feature of the language you
> > use to write code.  Circle is written in C, which does support
> > that.
>
> "does not", I believe you meant. Anyway, passing by reference can
> be quite evil.

I'm having problems with some of the semantics used here. I believe
(please, correct if I'm wrong) that "passing by reference" is very
possible in C. Making a function "take" the reference of a variable
(already passed) is not possible. ie

int x=0;

void f(int *i);
void g(int &i);

f(&x); // passing reference...
g(x);


Can somebody correct me? I'm not sure about this anymore...
--
Leonardo Herrera
mailto:leonardo.herrera@mercantil.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/04/01 PST