Using System, how can I dump the contents of a multidimensional array to the screen? I only require it for a 2-dimensional array that is being dynamically generated.
I'm creating my array using this method:
public static int[,] Alignment (int[] x, int[] y)
{
// initiate matrix to be filled
int[,] matrix = new int[x.Length,y.Length];
// fill first row to zeros
for (int i = 0; i < x.Length; i++)
{
matrix[i,0] = 0;
}
// fill first column to zeros
for (int j = 0; j < y.Length; j++)
{
matrix[0,j] = 0;
}
DumpMultiDArray(matrix);
return matrix;
}
and I'm trying to dump the array before returning it...
public static void DumpMultiDArray (int[,] MDArray)
{
for (int i = 0; i < MDArray.GetLength(1); i++)
// GetLength(1) can't seem to be found
}