A simple and quick but not elegant solution is to use C style strings here.
(or you could allocate the total amount of memory required from scratch, and copy over the original, finally freeing it)...
Type: Posts; User: manasij7479
A simple and quick but not elegant solution is to use C style strings here.
(or you could allocate the total amount of memory required from scratch, and copy over the original, finally freeing it)...
Red flags!
Using C memory allocation in C++ is walking through a minefield as non-pod objects are not constructed.
Here, std::string's allocators do not get the scope to reserve memory for the...