title: C++ Object Creation and Memory Allocation
body: <p>Let's say I have a simple Movie object that just keeps track of a few data members of name, length and cost.</p>
  
  <p>If in my driver file, I create a Movie object. Which is preferred and the difference of :</p>
  
  <pre><code>Movie firstMovie = Movie("Titanic", 126, 13.2);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Movie* firstMovie = new Movie("Titanic", 126, 13.2);
  </code></pre>
  
  <p>I would think that the latter is if we were to have the need to access this object if the method it was in were to be done executed. In other words, if the first object created was initialized like that in a method, then once the method is done executing, we would lose any connection since memory was not allocated for it. Is my way of thinking correct? This is not homework, more of a question that's been lurking since my transition from Java. Thank you.</p>