delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/05/09/09:34:07

Subject: Re: is it me?
To: OKRA AT max DOT tiac DOT net (Kimberley Burchett)
Date: Tue, 9 May 1995 12:23:36 +0100 (BST)
From: "B.S.Runnacles" <B DOT S DOT Runnacles AT soton DOT ac DOT uk>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

 Dear Kimberley..

Although I am only a mere undergrad, I think your problem is that you are 
attempting to pass a pointer to a pointer.  Arrays are just a pretty way
of dressing up pointers, such that foo[i] is often expanded as *(foo + i).
Hence when you pass Block (without the &) you are explicitly passing a 
pointer to the item in memory, the distinction between call by reference
and call by value don't come into it mate.  You can't pass a copy of
an explicit pointer, so calls with arrays are *always* passing the actual
memory item, not a copy.

I've never really followed what goes on with C++ call by reference, I
tend to stick to using the C way of thinking.

Hope this is clear, and not too much like being ravaged by a dead sheep.

Yours under-the-delusion-of-understanding-pointers

Ben Runnacles
Image, Speech and Intelligent Systems Group,
University of Southampton, UK.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019