Array.LongLength 속성은 Array의 모든 차원에 있는 총 요소 수를 나타내는 64비트 정수를 가져옵니다.
긴 데이터 유형의 배열이 -
라고 가정해 보겠습니다.long[,] arr1= new long[15, 35];
LongLength 속성을 사용하여 Array의 모든 차원에 있는 요소의 총 수를 나타내는 정수 가져오기 -
arr1.LongLength
배열 클래스의 Array.LongLength 속성을 구현하는 예를 살펴보겠습니다 -
예
using System;
class Program {
static void Main() {
long[,] arr1= new long[15, 35];
long len1 = arr1.GetLongLength(0);
Console.WriteLine(len1);
Console.WriteLine(arr1.LongLength);
}
} 출력
15 525