title: Using "new" operator to create objects in an array C++
body: <p>In Java </p>
  
  <pre><code>nodes[i] = new Object();
  </code></pre>
  
  <p>is a valid statement</p>
  
  <p>What is the C++ equivalent? </p>
  
  <p>EDIT:</p>
  
  <p>It seems I am not providing enough context. </p>
  
  <p>I was reading some Java code implementing a QuadTree, and I was curious on how I could rewrite that segment of code in C++.</p>
  
  <p>I did not need a <em>direct</em> equivalent, I wanted something that essentially means the same thing.</p>
  
  <p>In Java, you can do things like</p>
  
  <pre><code>class A
  {
  public A (someObject o);
  }
  </code></pre>
  
  <p>main method:</p>
  
  <pre><code>A aObject = new A(new someObject());
  </code></pre>
  
  <p>or in a loop:</p>
  
  <pre><code>for(int i = 0; i &lt; arr.length; i++)
  {
  arr[i] = new someObject();
  }
  </code></pre>
  
  <p>In C++ I know you can do:</p>
  
  <pre><code>std::vector&lt;someObject*&gt; arr;
  someObject* o = new someObject;
  arr.push_back(o);
  </code></pre>
  
  <p>Is there something similar to java's <code>new Object();</code> style of creating objects without explicit declaration in C++?</p>