title: change 2D array to 2D vector in c++
body: <p>I wanna change this array to vector</p>
  
  <pre><code>  len = numberOfPlayer();
    float cost[len][len];
  </code></pre>
  
  <p>I change this code to the code below but it doesn't work</p>
  
  <pre><code>  vector&lt;vector&lt;float&gt; &gt; cost(len) ;
  </code></pre>