title: Use of the & operator in C++ function signatures
body: <p>I'm currently reading through Accelerated C++ and I realized I don't really understand how &amp; works in function signatures.  </p>
  
  <pre><code>int* ptr=&amp;num;
  </code></pre>
  
  <p>means that ptr now holds the address to num, but what does that mean?</p>
  
  <pre><code>void DoSomething(string&amp; str)
  </code></pre>
  
  <p>from what I understand that is a pass by reference of a variable (which means passing the address) but when I do</p>
  
  <pre><code>void DoSomething(string&amp; str)
  {
    string copy=str;
  }
  </code></pre>
  
  <p>what it creates is a copy of str. What I thought it would do is raise an error since I'm trying to assign a pointer to a variable.</p>
  
  <p>What is happening here? And what is the meaning of using * and &amp; in function calls?</p>