Hello to everybody,
I'm a complete newby to c++ and in the upcomming months I wish to learn this language, (so please don't hold it against me if I use incorrect terminology; but correct me if I'm wrong...).
During my exploration of c++, these last days, I have come up a problem for which I haven't been able to find a solution anywhere, yet I'm convinced it is possible. I hope someone can tell me how to deal with it.
Here's the problem:
I want to generate a lot of objects using a for loop. I want to generate then names of those objects using a variable I use in the for loop. It would look something like this:
int i;
for (i = 1; i < 101;i++)
{
class_name object_name+i;
}
The desired effect would be 100 objects, named
object_name1,
object_name2,
object_name3,
...
object_name100.
I'm sure this is possible, but I can't work out how to acheive this.
I would be very gratefull if someone could hand me the solution.
Greatz,
Mbrio