title: Create reference to new object
body: <p>I am just learning C++, and I've come across the following conundrum:</p>
  
  <p>As a C++ newbie, I've read that using reference instead of pointers (when possible) is generally a good idea, so I'm trying to get into the habit early. As a result, I have a lot of methods which have the general form of</p>
  
  <pre><code>void myMethod(ParamClass const&amp; param);
  </code></pre>
  
  <p>Now, I'm wondering what is the best way to call these methods. Of course, each call will need a different object passed as a parameter, and as far as I know the only way to create it is the new operator, so now I'm doing the following:</p>
  
  <pre><code>myObject.myMethod(*new ParamClass(...));
  </code></pre>
  
  <p>While this method totally works, I'm wondering if there isn't another already-established "c++ way" of doing this. </p>
  
  <p>Thanks for the help!
  Dan</p>