title: Declare an array of objects using a for loop c++
body: <p>Okay. So I have declared an array of objects, and I have manually defined them using this code:</p>
  
  <pre><code>Object* objects[] =
  {
      new Object(/*constructor parameters*/),
      new Object(/*constructor parameters*/)
  }; 
  </code></pre>
  
  <p>Is there anyway to use some kind of a loop (preferably a for loop) to declare these? Something like:</p>
  
  <pre><code>Object* objects[] =
  {
      for(int i=0; i&lt;20; /*number of objects*/ i++)
      {
          new Object(/*constructor parameters*/);
      }
  }; 
  </code></pre>
  
  <p>But with proper syntax?</p>