title: C++ copying multidimensional vector
body: <p>I'm having problems copying a multidimensional vector, I've tried many things but this is the last one:</p>
  
  <pre><code>vector &lt; vector &lt; int &gt; &gt; a;
  vector &lt; vector &lt; int &gt; &gt; b;
  a.resize(10);
  b.resize(10);
  a[0][0] = 123;
  copy( a.begin(), a.end(), back_inserter(b) );
  cout &lt;&lt; b[0][0];
  </code></pre>
  
  <p>I'm trying to do a recursive loop that counts all possible routes in a grid within 10 moves. I'm trying to create a vector called <code>current_path</code> which would hold the current path for each recursion, when the <code>current_path</code> has 10 moves, It will copy the data from <code>current_path</code> to <code>all_paths</code>.</p>
  
  <p>The grid goes like this:</p>
  
  <pre><code>0  1  2 3
  4  5  6 7
  8  9  10 11
  12 13 14 15
  </code></pre>
  
  <p>You can only move to a square you touch so from 0 you can move to 1, 4 and 5. And from 1 to 3, 4, 5, 6 etc.</p>
  
  <p>The main idea is to copy the <code>current_path</code> to the next function call (recursive) so it would hold the <code>curren_path</code> up to that point, doing that until it's full (10 steps). After it's copied from <code>current_path</code> to <code>all_paths</code> I suppose I have to delete the <code>current_path</code>?</p>
  
  <p>I know how to efficiently calculate all steps but I'm having trouble copying the <code>current_path</code> and propably and how do I add the <code>current_path</code> to <code>all_paths</code> when I'm at 10 steps?</p>