📅  最后修改于: 2022-03-11 14:44:54.704000             🧑  作者: Mango
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];
}
}