Rank and Length properties of the two dimensional array : Array Rank : Data Structure C# Examples


C# Examples » Data Structure » Array Rank »

 

Rank and Length properties of the two dimensional array









    
using  System;

class  MainClass
{

    public  static  void  Main()
    {
        string[,]  names  =  {
            {"J",  "M",  "P"},
            {"S",  "E",  "S"},
            {"C",  "A",  "W"},
            {"G",  "P",  "J"},
        };

        
        Console.WriteLine("names.Rank  (number  of  dimensions)  =  "  +  names.Rank);
        Console.WriteLine("names.Length  (number  of  elements)  =  "  +  names.Length);

    }
}
    
   
  
   



Output

names.Rank (number of dimensions) = 2
names.Length (number of elements) = 12


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» Array Rank