在 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);
   }
}

更新於:2020-06-23

116 次瀏覽

開啟您的 事業

透過完成課程來獲得認證

開始
廣告