二維數(shù)組的行贫悄、列及總長度求法
int[,] a = new int[,] { { 1, 2, 3,4 }, { 5, 6, 7, 8 }, { 9, 10, 11,12} };
int b= a.GetLength(0);//行數(shù)
int c = a.GetLength(1);//列數(shù)
int d = a.Length;//總長度,行*列
二維數(shù)組的行贫悄、列及總長度求法
int[,] a = new int[,] { { 1, 2, 3,4 }, { 5, 6, 7, 8 }, { 9, 10, 11,12} };
int b= a.GetLength(0);//行數(shù)
int c = a.GetLength(1);//列數(shù)
int d = a.Length;//總長度,行*列