0

In cSharp, a 2D array is written as int[,] myArray = new int[,]

However, it has come to my attention that int[][] my Array = new int[][] is also OK.

I am wondering if the 2 has any difference or it is the same.

Chavez
  • 144
  • 4
  • The `[][]` approach lets you created a jagged array: https://stackoverflow.com/questions/2576759/what-is-a-jagged-array/2576763#2576763 – Sean May 18 '20 at 07:42
  • 1
    Does this answer your question? [What are the differences between a multidimensional array and an array of arrays in C#?](https://stackoverflow.com/questions/597720/what-are-the-differences-between-a-multidimensional-array-and-an-array-of-arrays) – NotFound May 18 '20 at 07:43

0 Answers0