title: C++ - need suggestion on 2-d Data structure - size of 1-D is not fixed
body: <p>I wish to have a 2-D data structure to store SAT formulas. What I want is similar to 2-D arrays. But I wish to do dynamic memory allocation. </p>
  
  <p>I was thinking in terms of array of vectors of the following form :- </p>
  
  <pre><code>typedef vector&lt;int&gt; intVector;
  intVector *clause;
  clause = new intVector [numClause + 1] ;
  </code></pre>
  
  <p>Thus <code>clause[0]</code> will be one vector, <code>clause[1]</code> will be another and so on. And each vector may have a different size. But I am unsure if this is the right thing to do in terms of memory allocation. </p>
  
  <p>Can an array of vectors be made, so that the vectors have different sizes ? How bad is it on memory management ? </p>
  
  <p>Thanks.</p>