title: int[n][m], where n and m are known at runtime
body: <p>I often need to create a 2D array with width and height (let them be n and m) unknown at compile time, usually I write :</p>
  
  <pre><code>vector&lt;int&gt; arr(n * m);
  </code></pre>
  
  <p>And I access elements manually with :</p>
  
  <pre><code>arr[j * m + i] 
  </code></pre>
  
  <p>I recently got told that I could instead write :</p>
  
  <pre><code>int arr[n][m] // n and m still only known at runtime.
  </code></pre>
  
  <p>So here are 2 questions :</p>
  
  <ol>
  <li>Is this behaviour allowed by the C++ Standard ?</li>
  <li>How should I pass such an array to a function ? g++ reports that arr has type <code>int (*)[n]</code>, but again, n is dynamic and not known outside the function where it is declared (<code>main</code>).</li>
  </ol>