I want to make a dynamic array of class objects. Though it is dynamic I have to calculate some size before initiating them; what strategy should I apply?
1 Answer
Use the std::vector class from the standard library. That implements a strongly-typed dynamic array. It can be found inside the header <vector>.