title: C++ New vs Malloc for dynamic memory array of Objects
body: <p>I have a class Bullet that takes several arguments for its construction. However, I am using a dynamic memory array to store them. I am using C++ so i want to conform to it's standard by using the new operator to allocate the memory. The problem is that the new operator is asking for the constructor arguments when I'm allocating the array, which I don't have at that time. I can accomplish this using malloc to get the right size then fill in form there, but that's not what i want to use :) any ideas?</p>
  
  <pre><code>pBulletArray = (Bullet*) malloc(iBulletArraySize * sizeof(Bullet)); // Works
  pBulletArray = new Bullet[iBulletArraySize]; // Requires constructor arguments
  </code></pre>
  
  <p>Thanks.</p>