a skeleton of my code is as follows:
vector<char**> myFunc(some param) {
char**first = new char*[some size];
char*second = new char[some other size];
}//sizes depend on param
while(...) {
vector<char**> myVec;
myVec = myFunc(param);
/* some stuff happens
*
*/
}//end while
As can clearly be deducted, I need to delete both first and second before the end of my while loop. I have tried to both delete[] myVec[i] (in a loop) but to no avail, as well as other permutations of this. Any ideas?
thanks! (I used new instead of malloc for 'simplicity' sake; as my understanding both are the same (besides delete only with new etc.)