Object names using variable contents?

I was wondering is it possible to create a new object named MemberX during runtime, where x is the value of a variable, without using a potentially never-ending if/else if statement?
No. If you need a bunch of variables (Something1, Something2, etc) you probably want an array.
Well, arrays are still limited in size, so I could only set a certain number of names.. However, I wanted to be able to create new objects of a pre-set structure during runtime, with a name that doesn't have to be written out in the programming. The idea is for a game, I was going to use int MemberCounter to keep track of how many party members you have. Then try to create a new object for each member as you add them. Then, name each successive object created MemberX, where X is the value of MemberCounter. And, finally, increase the value of MemberCounter by 1, but the idea is to have it so that I don't have to write out a limited number of names. If that isn't possible though, I guess an array would work.

And, thanks for the help.
closed account (D80DSL3A)
Sounds like a perfect job for a vector: http://www.cplusplus.com/reference/stl/vector/
A linked list may be well suited also.
Topic archived. No new replies allowed.