Logo 
Search:

C# Articles

Submit Article
Home » Articles » C# » CollectionsRSS Feeds

Example of Array.Rank Property

Posted By: Vivek Patel     Category: C#     Views: 0

Array.Rank is used in determining total dimensions of an array
 

Example of Array.Rank Property


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

namespace CSharpDemoApps
{
class Program
{
static void Main(string[] args)
{
// Creates and initializes a new integer array.
int[] myIntArray = new int[5] { 1, 2, 3, 4, 5 };

//Total dimensions of Array is determined using Rank Property
Console.WriteLine("Total dimensions of Array is : " + myIntArray.Rank);

Console.ReadLine();
}
}
}




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

namespace CSharpDemoApps
{
class Program
{
static void Main(string[] args)
{
// Creates and initializes a new integer array.
int[,] myIntArray = new int[2, 5] {
{ 1, 2, 3, 4, 5 },
{ 1, 2, 3, 4, 5 }
};

//Total dimensions of Array is determined using Rank Property
Console.WriteLine("Total dimensions of Array is : " + myIntArray.Rank);

Console.ReadLine();
}
}
}
  
Share: 

 
 
 

Didn't find what you were looking for? Find more on Example of Array.Rank Property Or get search suggestion and latest updates.

Vivek Patel
Vivek Patel author of Example of Array.Rank Property is from United States. Vivek Patel says

I have started working in .Net Technology since its beta release and lucky to got chance to work on .Net 1.1, 2.0 and now working on .Net 3.5. I have worked in both C# and VB.Net for Asp.net Projects. I can also provide Sharepoint development needs. I can efficiently switch role from Tech Lead and Developer. I have comprehensive knowledge of Asp.net Development. I have been award Microsoft Most Valuable Award twice in Asp.net Technology.

Blog: http://dotnetguts.blogspot.com

 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!