title: Creation of Dynamic Array of Dynamic Objects in C++
body: <p>I know how to create a array of dynamic objects. </p>
  
  <p>For example, the class name is Stock.</p>
  
  <pre><code>Stock *stockArray[4];
  for(int i = 0 ; i &lt; 4;i++)
  {
     stockArray[i] = new Stock();
  }
  </code></pre>
  
  <p>How do you change this to dynamic array of dynamic objects?</p>
  
  <p>What I tried:</p>
  
  <p>Stock <em>stockArrayPointer = new Stock</em> stock[4];</p>
  
  <p>It doesn't work and the error is "The value of Stock** cannot be used to initalize an entity of type Stock.</p>
  
  <p>Second question is after the creation of dynamic array of dynamic objects, what is the syntax to access the pointers in the array.</p>
  
  <p>Now, I use stockArray[i] = new Stock(); How will this change?</p>
  
  <p>Need some guidance on this...</p>