i'm using a pair variable to store some data and every time in the loop i need to delete the contents of the pair for reuse. the type of pair is:
pair <string,vecot< vector< string>>> p;
p.first.clear();
this is working for clearing the first part but for the second part it is not working. How to do this?
First of all you can use a local variable of type std::pair that will be declared inside the loop. So the destructors will be called automatocally.
And what is the problem of using p.second.clear()?