How can we initialize a multidimensional array without pre-existing values? Only the third one is correct, but it works with pre-existing values. I would like my multidimensional array to contain 10 or 20 values, and add them later on with numbers[y][x] :
int[][] numbers = new int[10][];
//List<int[]> numbers = new List<int[]>();
//int[10][]{ new int[]{}};
//correct : { new int[] {1, 2}, new int[] {3, 4, 5} };
numbers[0][0] = 58;
Would you know how to do this? (I don't know if [,]
is the same as [][]
by the way)
Thanks