Hello,
I have a C++ homework assignment, which forbids me to use list or vector and I have to store some data in arrays of std::string. I have to allocate it for 1000 records and when it comes near to this value, I should reallocate the array (for twice the previous size...).
What I do is I create new arrays using "new", but I don't know how copy the data from the previous array to the new one. I tried to use memmove, which gives me segfaults, probably because I state that I want to copy "Size_of_array * sizeof(string)", which I don't think work with std::strings.
How to easily and correctly do this? I hope I am understood :) And sorry for my English too.