# jagged arrays with multidimensional array

This is a discussion on jagged arrays with multidimensional array within the C# Programming forums, part of the General Programming Boards category; Jagged arrays, namely arrays of arrays is basically similar to a regular dimensional array, which is not hard to understand. ...

1. ## jagged arrays with multidimensional array

Jagged arrays, namely arrays of arrays is basically similar to a regular dimensional array, which is not hard to understand. But here within a jagged array, there is another array, which is kind of a bit vague to me.

here is a jagged array with a two dimensional array:

int [][,] jagged = new int [3][,];

// so there are three rows

|---------| // row 0;
|---------|

|---------| // row 1;
|---------|

|---------| // row 2;
|---------|

// When we assign jagged [0] a reference to a 4 x 2 array.

jagged [0] = int new [4,2];

// Does it mean that we assign four columns to the row 0?

|---------| |---------| |---------| |---------|
|---------| |---------| |---------| |---------|

// and within each row, there are two more rows?

|--0----1---| |--0----1---| |--0----1---| |--0----1---|
|------0----| |-------1----| |-----2-----| |------3-----|

// So when we assign value to jagged [0][1,0] = 10;
// Does it mean that we access to the second column, which is 1 of the row 0 and
// assign the value 10 to the second row of 1, which is above the column named 1
// 0 and 1, and we assign the 10 to 1, not 0?

2. Code:
`int [][,] jagged = new int [3][,];|`
Means that you have an array of 2D arrays.

Code:
`jagged [0] = int new [4,2];`
So you assign on jagged[0] a new 4X2 array.

jagged[0] =
* *
* *
* *
* *

If you do
Code:
`jagged [1] = int new [3,3];`
jagged[1] =
* * *
* * *
* * *

3. I thing that: here is a jagged array with a two dimensional array:

int [][,] jagged = new int [3][,];
_______________
medical SEO | doctor website | medical practice marketing