title: C++ Passing Objects by Reference
body: <p>I am trying to learn C++, and I am working through "Sams Teach Yourself C++ in 21 Days".</p>
  
  <p>I have been progressing quite well so far, and even got through the chapter on pointers without difficulty. However, a listing on "Passing Objects by Reference" has left me quite confused.</p>
  
  <p>There is a class with two constructors:</p>
  
  <pre><code>class SimpleCat
  {
  public :
      SimpleCat();
      SimpleCat(SimpleCat&amp;);
  ...
  };
  </code></pre>
  
  <p>two functions with the prototype:</p>
  
  <pre><code>SimpleCat FunctionOne( SimpleCat theCat );
  SimpleCat* FunctionTwo( SimpleCat *theCat );
  </code></pre>
  
  <p><em>/</em> What is confusing me is that when calling the second function, the second constructor <code>SimpleCat(SimpleCat&amp;);</code> is called. Could someone please explain? Any further searching has left me equally confused. <em>/</em></p>
  
  <p><strong>EDIT:</strong> I have made a mistake in my post here, the copy constructor (as I now know what it is, thank-you so much ) is called with the first function. I am sorry for the confusion. I know understand the link now and you have all helped tremendously. </p>