There will be two different types (let's assume your element type is integer):
As you hardly understand topic, start with 2D array (the other way allows for jagged array):
int [,] array = new int[4, 12];
array[2, 11] = 212;
The jagged array
is not really a 2D array: this is an array of integer arrays. Both inner and outer arrays are 1D. If you think about this words and experiment a bit, you will find a way around them: you initialize outer array (array of array with 1D rank
) and then do the cycle
and initialize every inner array with any (different!) lengths. That's why it's called "jagged": inner arrays all have different lengths.