title: how to retrieve an object inside a vector in c++
body: <p>I'm a C++ noob programmer... (I usually use Java) and now I've got some problems with pointers, references and vectors...</p>
  
  <p>I need to extract an <code>Object</code> from <code>vector&lt;Object&gt; objects</code> and for simplicity i would like to store <em>his reference</em> in another object cause I need to edit some parameters inside of it many times</p>
  
  <p>this is the code i've written so far:</p>
  
  <pre><code>Object myObject = getMyObject(id, objects); 
  </code></pre>
  
  <p>and <code>getMyObject</code> simply implements a <code>for</code> cycle which finds the right <code>object</code> with the right <code>id</code> and it returns it with <code>return objects[i]</code></p>
  
  <p>but if I understood right, this method duplicates the objects! so, in <code>myObject</code> there's a completely different <code>Object</code>, is it right?</p>
  
  <p>How should I do??</p>
  
  <p>Thank you very much!</p>