Richard wrote:
Quote:
ramif <ramif_47@yahoo.co.ukwrites:
>
Quote:
>Does call by reference principle apply to pointers??
>Is there a way to pass pointers (by reference) to functions?
>
Someone will be along to say there is no call by reference.
s/will/was/.
Quote:
This is kind of true.
As in, true up to arguments about definitions.
Quote:
But misleading and confuses nearly everyone.
It confuses people who have had it explained to them by confused
people.
Quote:
You can pass a pointer to an object which for all
Most.
Quote:
intents and meaning is a "reference" for the greater majority
of programmers.
Indeed.
Quote:
So for me, passing a pointer is indeed pass by reference.
And here are the definitional things. No, passing a pointer
isn't pass (or call) by reference. You can do all the things
that pass by reference does by passing pointers, /except/
the doing-it-implicitly that's part of the definition of
pass-by-reference.
Quote:
No matter what the standard says : word games
dont get the point across.
Exactly. Your confusion of terms doesn't make C have pass-
by-reference, in which the construction and dereference of
the necessary pointers is implicit and part of the machinery
of the language. C happens to have those constructions and
dereferences as directly accessible features, so it /doesn't
need/ to have pass-by-reference.
In a language like (the original) Pascal, you couldn't
simulate pass-by-reference with the rest of the language
features, and so it was much clearer that pass-by-reference
was a specific feature.
--
Historical Hedgehog
The "good old days" used to be much better.