How to get two dimensional array length in C#

1 Answer

0 votes
using System;
 
class Program
{
    static void Main() {
        int[,] arr = new int[3, 4];
 
        Console.WriteLine(arr.GetLength(0));
        Console.WriteLine(arr.GetLength(1));
    }
}
 
 
 
 
/*
run:
 
3
4
 
*/

 



answered Nov 25, 2020 by avibootz

Related questions

1 answer 132 views
1 answer 168 views
1 answer 125 views
...