title: Pointer and vectors in C++
body: <p>I'm starting with C++ and I have a doubts:</p>
  
  <p>I'm making a function which will return a vector of objects of a class <code>MyClass</code>.</p>
  
  <pre><code>vector&lt;MyClass&gt;* myMethod()
  </code></pre>
  
  <p>The first question is, it's correct to return a pointer?</p>
  
  <p>The second question is: if I'm going to return a pointer, should I also insert pointer of MyClass object into the vector?</p>
  
  <pre><code>MyClass* object;
  myVector.push_back(*object);
  </code></pre>