I am wondering what is the difference between the two ways to define a Multidimensional Array in C#.
You can use object[][] and object[,] to work with multidimensional array.
Are there functional differences?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
object[][]is a notation for array of arrays. The second oneobject[,]is a two dimensional array.The main difference is while the first one can contain different length “inner” arrays, the second one must be rectangular (e.g. 4×7).
Example:
This is an official tutorial.