title: C++ How to create a dynamic array of vectors?
body: <p>I'm having problem initialising an array of std::vectors.</p>
  
  <p>I'm declaring and initialising it like this:</p>
  
  <pre><code>vector&lt;component_change*&gt;* _changes;
  _changes = new vector&lt;component_change*&gt; [numThreads];
  </code></pre>
  
  <p>in the hope that it's in the same form as this:</p>
  
  <pre><code>int * foo;
  foo = new int [5];
  </code></pre>
  
  <p>but when I hit a breakpoint after the initialisation, _changes' size is 0.
  What am I doing wrong and how can I fix it?</p>
  
  <p>I don't want to use a vector of vectors as the number I need remains constant throughout the program but depends on the current hardware. And I'm not just looking for a single vector (Each vector will be used by a different thread then merged when the threads have finished their tasks).</p>
  
  <p>Thanks guys! :)</p>