2
Reply

Dynamic Multidimensional Array

D S

D S

Jun 7 2012 11:09 AM
2.2k
I have a function...
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. 
} 

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 ([,]).

Any help?


Answers (2)