0

I have an array of array wich all have the same length.
Which syntax is to be preferred :
multidimensional : string[,] names = new string[5,4];
or
jagged : string[][]names = new string[5][4];
Or is it, in this case just a matter of style?
I searched this site and I read among others http://msdn.microsoft.com/en-us/library/aa288453(VS.71).aspx

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by ddanbe
0

Look, my friend Danny, they're different
Array of Array == one-to-many, imagine every cell in the above array has all cells in the below array..
I know, I can describe it but I'll draw it for you...

1

I attached the images, I hope it clarifies...

Votes + Comments
Very intructive! This man knows what he his doing!
Attachments arrays.JPG 21.25 KB
0

Thanks Ramy!
I see this more clearly now!
I understand the concept of jagged arrays. But from your drawing I can see there is always a difference between multidim and jagged.
Thank you for that clarification.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.