Assuming I have a vector and an iterator for it. Assuming also that the vector contains elements. Also assume a function fxn() exists.
Does the call to fxn() assuming that fxn does something with the parameter it gets, say write to a file or to add it to another vector cause a memory leak?
Rome did not create a great empire by having meetings, they did it by
killing all those who opposed them.
- janvier -
Code:
...
struct A;
void fxn(A& theA);
...
vector<A> vectorA;
vector<A>::iterator iterA;
...
...
for(iterA = vectorA.begin(); iterA != vectorA.end(); ++iterA)
{
fxn(*iterA);
}
Does the call to fxn() assuming that fxn does something with the parameter it gets, say write to a file or to add it to another vector cause a memory leak?
Rome did not create a great empire by having meetings, they did it by
killing all those who opposed them.
- janvier -