小编mis*_*een的帖子

GetLength()方法在数组上无法正常工作

这是一个C#代码.

它输出以下文字:

tab.Length = 6
tab.Rank = 2
Length of dim 0 of tab : 0
Length of dim 1 of tab : 1
Run Code Online (Sandbox Code Playgroud)

我期待以下文字:

tab.Length = 6
tab.Rank = 2
Length of dim 0 of tab : 2
Length of dim 1 of tab : 3
Run Code Online (Sandbox Code Playgroud)

为什么不?谢谢.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TableTest
{
    class Program
    {
        static void Main(string[] args)
        {
            int[,] tab = new int[2, 3];

            for (int i = 0; i < …
Run Code Online (Sandbox Code Playgroud)

c#

1
推荐指数
1
解决办法
233
查看次数

标签 统计

c# ×1