Re: passing char arrays by reference
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Sun, 08 Feb 2009 09:28:29 +0000
Keith Thompson said:
Richard Heathfield <rjh@xxxxxxxxxxxxxxx> writes:
[...]
To be precise, a pointer /is/ a reference.
In C, yes. There are other contexts in which "pointer" and
"reference" mean different things. (I'm thinking of C++.)
Right. I was referring to clc::reference, not c++->reference.
Note that this does not mean that passing a pointer equates to
pass by reference. It doesn't. You can pass a reference in C, but
you can't pass /by/ reference!
Agreed. But another way to look at it is that passing by
reference is an abstract concept that C doesn't support directly,
but you can *implement* pass-by-reference in C by careful use of
pointers.
How?
Similarly, C doesn't directly support linked lists, but
you can implement linked lists by careful use of pointers.
Linked lists, I'll grant you - but pass-by-reference in C? This I
have to see. :-)
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- Follow-Ups:
- Re: passing char arrays by reference
- From: Keith Thompson
- Re: passing char arrays by reference
- References:
- passing char arrays by reference
- From: jackassplus@xxxxxxxxx
- Re: passing char arrays by reference
- From: Richard Heathfield
- Re: passing char arrays by reference
- From: Richard
- Re: passing char arrays by reference
- From: Ian Collins
- Re: passing char arrays by reference
- From: Richard
- Re: passing char arrays by reference
- From: Ian Collins
- Re: passing char arrays by reference
- From: Richard Heathfield
- Re: passing char arrays by reference
- From: Keith Thompson
- passing char arrays by reference
- Prev by Date: Re: Can anyone please explain this to me -- thanks
- Next by Date: Re: Can anyone please explain this to me -- thanks
- Previous by thread: Re: passing char arrays by reference
- Next by thread: Re: passing char arrays by reference
- Index(es):
Relevant Pages
|