How to add a column to a two dimensional array
<p>I have data in a two dimensional array with n rows and p columns.</p>

<p>For example:</p>

<pre><code>vector&lt;vector&lt;int&gt; &gt; dynamicArray(ROWS, vector&lt;int&gt;(COLUMNS));

for(int i = 0;i &lt; dynamicArray.size();++i){
      for(int j = 0;j &lt; dynamicArray[i].size();++j){
           dynamicArray[i][j] = i*j;
      }
}
</code></pre>

<p>Now, I want to add several columns to this array.  I tried the following (Add a column of all 10s to the array), but if failed:</p>

<pre><code>for(int i=0; i &lt; dynamicArray.size(); i++){
    dynamicArray[i].push_back(10);
}
</code></pre>

<p>Is there a way to do this?</p>

<p>Thanks!</p>
