c 2b 2b functions dynamic vector

Solutions on MaxInterview for c 2b 2b functions dynamic vector by the best coders in the world

showing results for - "c 2b 2b functions dynamic vector"
Jaylene
21 Oct 2016
1void FreeMemory(string *&v) {
2    if (v != nullptr) {
3        delete[] v;
4        v = nullptr;
5    }
6
7}
8
9void AssignMemory(string *&v, int n) {
10    if (v != nullptr) {
11        FreeMemory(v);        
12    }
13    if (n>=0) {
14        v = new string[n];
15    }
16}
17
similar questions
queries leading to this page
c 2b 2b functions dynamic vector