Re: pointer/ref question

From: Gary (glabowitz_at_comcast.net)
Date: 02/28/04


Date: Fri, 27 Feb 2004 23:27:26 -0500


"Leor Zolman" <leor@bdsoft.com> wrote in message
news:fm304096b85pukvag6hml2bn2a3enuepmn@4ax.com...
> On Fri, 27 Feb 2004 20:00:02 -0000, "Paul" <pcr1000011<spam avoider>>
> wrote:
>
> >Why don't we try to change the phrase 'pass by reference' to something
like
> >'pass by actual' as it can be spurious.
> >I know I have the habit of saying pass by reference when a pointer is
being
> >used which is probably not technically correct and could be
misinterpreted,
> >a bad habit I think and I will try to start using 'pass by actual' or
> >something else.
> >
>
> I think the phrase "pass by reference" has been grandfathered into C and
> C++ such that it is now indistinguishable, /out of context/, from the
> phrases "pass by address" or "pass by name". So much so, that if I read or
> hear anything like "the function parameter uses pass-by-reference", I've
> gotten scant more information from that as I would have from, "The
function
> takes a parameter".
>
> I just went into more detail on this then I thought I was going to in
> another post within this thread, so go see that one (time stamp within
> minutes of this one) for more of my ranting...

I teach it as "pass by value" and "pass a reference" since pass by reference
is already taken!
My "logic" is that when you pass by value, an actual value (copy thereof) is
"passed" to the called function to do with as it pleases.
When you pass a reference, the caller gets the ability to refer to the value
directly using an identifier of its choosing to "refer" to the value
wherever the heck it is.
It's unclear to me if students are getting the difference, however. I never
know if they get anything!

-- 
Gary


Relevant Pages

  • Re: Nefertitis lovely elongated head
    ... on the left you see the reference to the shot ... and the Olmec water bringer, but you also see the reference to the ... they are saying on the right, that it was defeated in a war, and above ... And can communicate with that conscious computer. ...
    (sci.archaeology)
  • Re: Nefertitis lovely elongated head
    ... on the left you see the reference to the shot ... the one on Mars. ... they are saying on the right, that it was defeated in a war, and above ... And can communicate with that conscious computer. ...
    (sci.archaeology)
  • Re: Why choose a paragraph element for a paragraph?
    ... The man visiting the blonde women in the flat above you is your ... a meaning independent of the actual reference. ... refer to or point to the very same and one thing in the world. ...
    (alt.html)
  • Re: name range from absolute to relative
    ... If you want a formula to refer to an absolute column (always column C ... because a relative reference in R1C1 notation DOES NOT CHANGE when you ... refersto formula will appear to change: you have to keep working out what ... based on the previously referenced cells. ...
    (microsoft.public.excel.worksheet.functions)