Possible Duplicate:
Dynamically Growing an Array in C++
I want to create a loop (do while) and create there until a specidfic case(while) objects of a class.
Is it possible not to define the number of the objects(for example in an array of objects). I thought to store them in a txt. However is there alternative just with the use of memory??
Use std::vector<> and you don’t need to handle the allocation at all. Just iterate and add to the vector when you need to. It will grow dynamically to accommodate its contents.