Mail Archives: djgpp/1995/05/09/09:34:07
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 -