dynamic object creation

gtm (53)
So basically I know this isnt possible but I've come across an issue working on a game

If I have an unknown number of objects to create and destroy, say for instance a monster, or bullets, or something that is not a fixed element, what is the method for going about this?
The only thing I can think of is to just create a massive array of the objects and construct and destruct them as needed.. but that seems like a huge waste of memory. and what if I end up going beyond the bounds of the array then? it just doesnt seem practical to me.

strongdrink (456)
Check out std::vector http://cplusplus.com/reference/vector/vector/?kw=vector
Registered users can post here. Sign in or register to post.