|
-
July 28th, 2011, 02:35 AM
#16
Re: looking for a good pointer info
 Originally Posted by Paul McKenzie
The "&" used in this context is not the reference operator, it is the address-of operator.
Since addresses are pointers, then you are passing by value (the value being the address-of i).
I doubt olivthill2 wasn't aware of that fact, probably he meant "pass by" as a semantical language indipendent concept; in this sense, pointers implement pass-by-reference semantics in C.
besides, if one think at function calls only in terms of initialization rules of its arguments types, then only pass-by-value exist in C or C++, because you always have a source type that is used to initialize the content of a target a type ( yes, references are not object, being not required to have a storage; nonetheless it makes sense identifying their "value" with a non-null pointer ).
indeed, I think that speaking of "passing X by Y" makes no pedagogical sense in C++, because it's not necessary ( as above, you can always represent the function invokation process as a value-initialization mechanism ) and it's also dangerous because it hides the underlying initialization mechanism ( consider copy-elision or special conversions, like array decay, etc... ).
-
July 28th, 2011, 04:58 AM
#17
Re: looking for a good pointer info
 Originally Posted by superbonzo
indeed, I think that speaking of "passing X by Y" makes no pedagogical sense in C++,
I think it's pedagogically best to stick to conventional terminology.
And it's quite a difference whether a language natively supports pass by reference or you must simulate it.
-
July 28th, 2011, 05:15 AM
#18
Re: looking for a good pointer info
 Originally Posted by laserlight
I think Skizmo is talking about shortcut icons and symlinks;
Or maybe he's talking about a dog 
http://www.dogbreedinfo.com/pointer.htm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|