Passing references to functions to be assigned to pointers in C++, Which way is better?
<p>I'm wondering which one is better of these two implementations of passing addresses to pointers.  Is there a data exchange in the 1st one that doesn't happen in the 2nd one? Is the second one a more efficient way?  More readable? both the same?</p>

<p><strong>Version 1</strong></p>

<pre><code>void ptrFunction(int&amp; arg)
{
    int* ptr = &amp;arg;
    std::cout&lt;&lt;"The pointer's value:" &lt;&lt; *ptr &lt;&lt; "\n";
}

int main()
{
    int  x=5;
    ptrFunction(x);
    return 0;
}
</code></pre>

<p><strong>Version 2</strong></p>

<pre><code>void CallViaPointers(int *arg)
{
  int *ptr = *arg;
  std::cout &lt;&lt; "The pointer's value: " &lt;&lt; *ptr;
}

int main()
{
    int x = 100;
    CallViaPointers(&amp;x);
    return 0;
}
</code></pre>
