You might also be able to use the Boost Pointer Container Library. Not specifically recommended here (again because you're using arrays instead of single objects, though std::string
would take care of that), but it's a useful and little-known library that solves the problem stated in the title.