0

What are the differences between using a jagged array (array of arrays) and a multidimensional array? I'm mostly looking for when to use one over the other.

Array.Copy as an example seems to work just fine with an array of arrays, but I don't know if it's even possible to use a similar mechanic as flexibly with a multidimensional array.

Would an array of arrays be faster for the compiler in C# since the compiler is optimized for single dimensional arrays?

Mythics
  • 773
  • 1
  • 10
  • 19
  • 4
    [What is differences between Multidimensional array and Array of Arrays in C#?](http://stackoverflow.com/questions/597720/what-is-differences-between-multidimensional-array-and-array-of-arrays-in-c) – Zbigniew Jun 11 '13 at 16:51
  • 2
    [Why we have both jagged array and multidimentional array?](http://stackoverflow.com/questions/4648914/why-we-have-both-jagged-array-and-multidimentional-array) – Zbigniew Jun 11 '13 at 16:52
  • See http://blog.mischel.com/2013/05/08/are-jagged-arrays-faster-than-rectangular-arrays/ for a little info on the relative speed of the two array types. – Jim Mischel Jun 11 '13 at 19:02
  • Thanks all for the replies. I definitely have my answer now. :) – Mythics Jun 13 '13 at 10:50

0 Answers0