std::vector<Node*> *emptyVec= new vector<Node*> ;
std::vector<Node*> *foundPointers= searchByTag(findVal,MainRoot,emptyVec);
this is part of one of my modules, i need a vector of pointer input to the searchByTag function which appends each value it finds to the "emptyVec"that is passed in.
I want to know if the first statement would lead to a memory leak?
if so is there any way to avoid this?
If I assign the emptyVec = NULL , it gives me an exception when I try to push a value into it.
Would really appreciate it if any of you could help me with this.
Thanks in advance