yaronusa

asked on

# How to count number of dimensions in double array in c# csharp c sharp ??

How do I count number of dimensions in double array?

I have an array:

int[,] x= new int[10,5]; //Pretend my program is not aware of these dimensions.

I know I can find out the length of the "second dimension", like this:

x.getLength(0) //returns 5

But how can I find out how big the "first" dimension is?

I have an array:

int[,] x= new int[10,5]; //Pretend my program is not aware of these dimensions.

I know I can find out the length of the "second dimension", like this:

x.getLength(0) //returns 5

But how can I find out how big the "first" dimension is?

ASKER CERTIFIED SOLUTION

membership

This solution is only available to members.

To access this solution, you must be a member of Experts Exchange.

So, in code this looks something like:

```
int[,] x = new int[10, 5];
return x.Rank;
```

You're welcome :)

ASKER