在 C# 中獲取三維陣列的秩
若要獲取三維陣列的秩,請使用 Rank 屬性。
設定三維陣列。
int[,,] arr = new int[3,4,5]
現在獲取秩。
arr.Rank
讓我們看看完整的程式碼。
示例
using System; class Program { static void Main() { int[,,] arr = new int[3,4,5] Console.WriteLine("Dimensions of Array : " + arr.Rank); } }
廣告