delete vectors element through iterator

1
2
3
4
5
std::vector<int*> vPtr;

int* ptr1 = new int(1);

std::vector<int*>::iterator iter = vPtr.begin();

how do i delete the vPtr[0] through iterator?


With the member function erase(...):

http://www.cplusplus.com/reference/vector/vector/erase/

Note 1: Other iterators may become invalid.
Note 2: The value will not be deleted.
Topic archived. No new replies allowed.