title: C++ multi-dimensional array initialization
body: <p>in C++ I want to initialize a double matrix (2-dimensional double array) like I would normally do without pointers like so:</p>
  
  <pre><code>    double data[4][4] = {
      1,0,0,0,
      0,1,0,0,
      0,0,1,0,
      0,0,0,1
  };
  </code></pre>
  
  <p>However, since I want to return and pass it to functions, I need it as a <code>double**</code> pointer. So, basically I need to initialize data in a nice way (as above), but then afterwards I need to save the pointer to the 2D-array without losing the data when the function exits.</p>
  
  <p>Any help on this? :-)</p>