2
Answers

How to create an object whose name is variable

Peter Gent

Peter Gent

15y
2.6k
1
I am trying to create a several different dictionary lists that will all be created inside of a loop, so I am trying to send in a variable to give each one a different name

I am looking for something that is a kind of like this (this does not work though)

for (int i=0; i< list.Count; i==)
{
        // this is where the name would look different depending on the amount of times through the loop
        DictionaryList<string> [i].ToString = new DictionaryList<string>();
}
Answers (2)