Naming a variable with another variable
I'm trying to create a loop that will create some variable as it goes through and then add the variables to an array. I want to name the variables created based on their position in the array, something like this;
now obviosuly this isn't working since name is used more than once, but is there a work around that someone could suggest? even a way of ranbomly generateing some names may work, but I'm not sure as the program will need to be able to call these names later. I wont need to know them, but the program will.
for (int i = 0; i < 5; i++)
string name = i.ToString();
wallarray[i] = name = new Nmode(Content);
Thanks in advance for any help