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

Re: Good documentation on c/c++ pointers?



"Bryan J. Smith" <b.j.smith@ieee.org> wrote ..
> Well, there are countless applications.  But largely so we can switch
> the value a variable returns without changing any memory.

mike808@users.sourceforge.net wrote:
> We also use pointers so that we _don't_ have to put potentially large
> data structures on a stack to pass this information to some function
> (or "method" in OO-parlance).

That's still follows my statement -- we're not changing any memory.

I wasn't sure he had been taught about the "stack" yet, how parameter
passing to functions actually work, etc..., so I didn't want to jump
there.

What Mike is talking about is "pass by reference," instead of "pass
value."  Instead of passing the values into a function call, you pass a
reference (pointer) into a function call to the value(s).


-- 
Bryan J. Smith                                 b.j.smith@ieee.org 
------------------------------------------------------------------ 
Beware of advocates who justify their preference not in terms of
what they like about their "choice," but what they did not like
about another option.  Such advocacy is more hurtful than helpful.



-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.