title: std::memcpy and copying data from 2D vector
body: <p>I have <code>int *a</code> with for 5x4 matrix, where 5 is row and 4 is column.</p>
  
  <p>The memory allocation for a matrix is column are continuous and every row is started after individual column.</p>
  
  <p>I like to copy data from <code>vector&lt; vector &lt;int&gt;&gt; b;</code></p>
  
  <p><code>b</code> also have same size and dimension have 5 rows and 4 columns.</p>
  
  <p>How I obtained data for <code>b</code> is</p>
  
  <pre><code>b.resize(5);
  for(int i = 0; i &lt; 5; i++){
      b[i].resize(4);
  }
  </code></pre>
  
  <p>I like to copy data from <code>b</code> to <code>a</code>.
  Is it possible to use <code>std::memcpy(a, &amp;b, sizeof (int)*20)</code>?</p>
  
  <p>EDIT:</p>
  
  <p>Sorry I like to copy the other way.
  <code>std::memcpy(&amp;b, a, sizeof (int)*20)</code></p>