I\'d like to set up a multidimensional list. For reference, I am working on a playlist analyzer.
I have a file/file-list, which my program saves in a standard list.
Here is how to make a 2 dimensional list
// Generating lists in a loop.
List> biglist = new List>();
for(int i = 1; i <= 10; i++)
{
List list1 = new List();
biglist.Add(list1);
}
// Populating the lists
for (int i = 0; i < 10; i++)
{
for(int j = 0; j < 10; j++)
{
biglist[i].Add((i).ToString() + " " + j.ToString());
}
}
textbox1.Text = biglist[5][9] + "\n";
Be aware of the danger of accessing a location that is not populated.