title: Difference between reference and non-reference in C++
body: <p>Lets say we have the following code that doesn't use references:</p>
  
  <pre><code>int val = 5;
  int val2 = func(val);
  
  int func(int v) {
     return v * v;
  }
  </code></pre>
  
  <p>Would the code be better with using references? I understand the difference between pointers and references, but not when to use references as opposed to not use them.</p>