[Solved] Arrays In loops by C# [closed]


IMO, best will be to use a Dictionary<string,int[][]>.

During creation you will place a new array (which you just created) and assosiate it to the key "a" + i.

To get this array, just get the value attached to the relevant key.

Something like (C#-like pseudo code):

var map = new Dictionary<string,int[][]>();
for(int i=1;i<10;i++)
{
    var temp = new int[10][3];
    map["a" + i] = temp
}

and to get a value just use map[key] (for example map["a7"] will get the 7th element).


A good alternative would be to use a 3D array.

2

solved Arrays In loops by C# [closed]