title: How to convert one-dimensional array into two-dimensional without memory allocating?
body: <p>I have a filled one-dimensional array <code>double *vals</code> as a class component with sizes <code>Nn[0]*Nn[1]</code>. I need to get 2-dimensional array <code>**w (w[Nn[1]][Nn[0]])</code> without allocating new memory for it, e.g. i need to represent <code>vals</code> as 2-dimensional array.</p>
  
  <p>Using g++ compiler i can make</p>
  
  <pre><code>double (* w)[Nn[0]] = (double (*)[Nn[0]])val;
  </code></pre>
  
  <p>But VS compiler or intel compiler don't allow to use non-constant expression as dimension array.</p>
  
  <p>In general, I can just use element in initial <code>vals</code> array converting 2 <code>int</code> indices (i,j) of <code>w[i][j]</code> element into global index and do not declare <code>w</code> at all. But it would be great if it's possible to get 2-dimensional array <code>w</code> on initial memory (with compiling with intel compiler too). So is there any way to do it?</p>