title: C++ function call with type pointer, parameter confusion: incomplete type is not allowed
body: <p>I'm trying to wrap my head around C++. I'm going to just give you tiny pieces to help illustrate the idea without making things to convoluted. Btw, im only implementing these methods, i cannot change the setup or parameters.</p>
  
  <p>I have a class for a dynamic array data structure that holds objects called stocks:</p>
  
  <pre><code>typedef class Stock ArrayType;
  
  class DynamicArray {
      ArrayType** items;
      int numberOfElements;
      ...
  }
  </code></pre>
  
  <p>Here's its constructor. I'm supposed to allocate the array and add one item, then set the number of elements.</p>
  
  <pre><code>DynamicArray::DynamicArray(ArrayType* const item){
      Stock *items = NULL; // ... i guess? pointers to pointers confuse me
      // now im guessing i need to create a actual stock array and point the above pointer to it
      items = new Stock[1]; // ERROR: incomplete type is not allowed? I've tried several things, and cant get rid of the red squiggles
      this-&gt;numberOfElements = 1;
  }
  </code></pre>