creating ten uniquely named objects
I want to create ten objects within a loop, each object obviously should have a unique name
I am creating ten instances of TestObject
Code:
for (int i = 0; i < 10; i++)
{
TestObj UNIQUENAME = new TestObj();
}
how do i create a unique name using the loop counter i eg TestObj1, TestObj2 etc
Re: creating ten uniquely named objects
Create an array of objects, so that you don't need a name, but an ordinal reference to the object's position in the array.
Re: creating ten uniquely named objects
Quote:
Originally Posted by mendhak
Create an array of objects, so that you don't need a name, but an ordinal reference to the object's position in the array.
I'd do something like that too. ;)