CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Join Date
    Oct 2008
    Posts
    1,456

    Re: looking for a good pointer info

    Quote Originally Posted by Paul McKenzie View Post
    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... ).

  2. #17
    Join Date
    May 2009
    Posts
    2,413

    Re: looking for a good pointer info

    Quote Originally Posted by superbonzo View Post
    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.

  3. #18
    Join Date
    May 2009
    Posts
    2,413

    Re: looking for a good pointer info

    Quote Originally Posted by laserlight View Post
    I think Skizmo is talking about shortcut icons and symlinks;
    Or maybe he's talking about a dog

    http://www.dogbreedinfo.com/pointer.htm

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured