title: C++: difference between ampersand "&" and asterisk "*" in function/method declaration?
body: <p>Is there some kind of subtle difference between those:</p>
  
  <pre><code>void a1(float &amp;b) {
      b=1;
  };
  a1(b);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>void a1(float *b) {
      (*b)=1;
  };
  a1(&amp;b);
  </code></pre>
  
  <p>?</p>
  
  <p>They both do the same (or so it seems from main() ), but the first one is obviously shorter, however most of the code I see uses second notation. Is there a difference? Maybe in case it's some object instead of float?</p>