c++ functions dynamic vector
void FreeMemory(string *&v) {
if (v != nullptr) {
delete[] v;
v = nullptr;
}
}
void AssignMemory(string *&v, int n) {
if (v != nullptr) {
FreeMemory(v);
}
if (n>=0) {
v = new string[n];
}
}