I wish to dynamically allocate set of objects(can be several hundreds). Part of those objects are text fields. Because std::string offers nice string manipulations, I would prefer having the object member parameters of type std:string.
However, std::string is dynamically resizable object. To me, this goes against the dynamically allocated objects containing std::string: There could be allocated memory overflow, if the std::string gets larger than planned.
- Can I kindly ask for advices whether std::string is suitable as a parameter for dynamically allocated objects?
- How to manipulate with std::string, so there will not be memory overflow?
- Is std::string suitable as a member parameter even if hundreds of objects will be allocated dynamically?