L
linux_bp
I have an stl vector array which stores the pointers to objects.
To delete the array i am using:
std::vector<*foo> bar;
....
for (vector<*foo>::iterator itr = bar.begin(); itr != bar.end(); )
{
delete itr;
itr = NULL;
}
Do i need to clear the bar array after this using bar.clear();
if i do not use bar.clear() what could be the implications.
To delete the array i am using:
std::vector<*foo> bar;
....
for (vector<*foo>::iterator itr = bar.begin(); itr != bar.end(); )
{
delete itr;
itr = NULL;
}
Do i need to clear the bar array after this using bar.clear();
if i do not use bar.clear() what could be the implications.