Difference between int f(int *i) and int f(int &i)
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/57483/what-are-the-differences-between-pointer-variable-and-reference-variable-in-c">What are the differences between pointer variable and reference variable in C++?</a><br>
  <a href="http://stackoverflow.com/questions/114180/pointer-vs-reference">Pointer vs. Reference</a>  </p>
</blockquote>



<p>To do a call-by-reference in C++, I think I could use either of those two:</p>

<pre><code>int f(int *x);
int g(int &amp;x);
</code></pre>

<p>They would be called like so:</p>

<pre><code>int *w;
f(w);
g(*w);

int y;
f(&amp;y);
g(y);
</code></pre>

<p>Is there a difference in the functions <code>f</code> and <code>g</code>? I should be able to work with <code>x</code> as an <code>int*</code> pointer and <code>*x</code> as an <code>int</code> inside both functions. So what is the difference?</p>
