I try to write an int-Array, but
why I can't write:
int[][,] JaggedInt = new int[5][5,5];
and how can I write a similar Jagged int as above.
For a jagged array you need to initialize each array separately:
int[][,] JaggedInt = new int[5][,];
for(int i = 0; i < 5; i++)
JaggedInt[i] = new int[5,5];
if it were a 3-dimensional array instead of a jagged array you could do:
int[,,] JaggedInt = new int[5,5,5];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With