【问题标题】:Size of one index of a multidimensional array [duplicate]多维数组的一个索引的大小[重复]
【发布时间】:2016-03-20 21:55:57
【问题描述】:

我已将两个三维数组定义为:

int[, ,] Link_k = new int[length1, length1, length1];
int[][][] Link_k2 = new int[length1][][];

其中length1 是可变的,可以是任何整数。

现在在我的代码中,我需要知道两个数组的第一个索引的大小。有谁知道我怎么能得到?

【问题讨论】:

  • @doctor、Ash、Rahul Tripathi,我已将我的问题换成了另一个问题。
  • 请不要那样做。

标签: c# .net


【解决方案1】:

您可以使用GetLength(int dimension) 方法来确定您想要的任何维度的大小。

【讨论】:

    猜你喜欢
    • 2015-05-16
    • 1970-01-01
    • 2021-04-15
    • 1970-01-01
    • 1970-01-01
    • 2012-06-19
    • 2020-03-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多