title: C# Dynamic multidimensional array
body: <p>I have a function...</p>
  
  <pre><code>private double[,] AddToArray(double[,] array, double[] dataToAdd)
  {
      // Make a new row at the end of 'array' and copy values 
      // from 'dataToAdd' into the new row.
      //
      // Return the new, modified array.
  
  }
  </code></pre>
  
  <p>However 'double[,]' isn't dynamic and I dont know what the final size of the array will be. I can create a List from it and add the new row to the list, but then I cant seem to convert it back to a double[,]. The List.ToArray() wants to output a jagged array (double[][]). This wont work. I'm interfacing with a program developed in LabVIEW and LV refuses to accept a jagged array. LV is happy with a fixed array ([,]).</p>
  
  <p>Any help?</p>