2
比方說,我有以下幾點:僅查找第一個維度的長度在一個多維數組
public void MakeMatrix(int matrixLength)
{
int[,] Matrix = new Matrix[matrixLength,matrixLength]
PopulateMatrix(Matrix);
PrintMatrix(Matrix);
}
在PrintMatrix(int[,] Matrix)
功能,怎麼我只找到一個多維度的長度維數組?
public void PrintMatrix(int[,] Matrix)
{
int intLength = // I don't know what to put here <===================
for (int k = 0; k < intLength ; k++)
{
for (int l = 0; l < intLength; l++)
{
Console.Write("{0,2} ", Matrix[k, l]);
}
Console.WriteLine();
}
}
.size()[0]或不服這樣的 – 2010-01-09 03:51:54