Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is there a simple way to retrieve the size of an array? For example:

 

If I declare a two dimensional integer array,

 

int[,] ia = { { 1, 2 }, { 3, 4 }, { 5, 6 } };

 

then I would like something like ia.Size, or ia.Dimensions that returns an integer array containing 3,2.

 

ia.Rank reveals that there are two dimensions, and ia.Length tells me that there are 6 elements, but I can't find what I want.

 

Thanks in advance.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...