title: Two ways of passing by reference in C++?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong>
    <a href="https://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>
    <a href="https://stackoverflow.com/questions/2139224/how-to-pass-objects-to-functions-in-c">How to pass objects to functions in C++?</a></p>
  </blockquote>
  
  
  
  <p>I am learning about reference parameters and got the following question:</p>
  
  <p>What is the difference between this:</p>
  
  <pre><code>void B(int* worthRef) {
      *worthRef += 1;
  }
  
  int main() {
      int netWorth = 55;
      B(&amp;netWorth);
      return 0;
  }
  </code></pre>
  
  <p>And this:</p>
  
  <pre><code>void B(int &amp;worthRef) {
      worthRef += 1;
  }
  
  int main() {
      int netWorth = 55;
      B(netWorth);
      return 0;
  }
  </code></pre>