vector<Foo*> tehList;tehList.push_back(new Foo());tehList.push_back(new Foo());tehList.push_back(new Foo());tehList.push_back(new Foo());tehList.push_back(new Foo());//we can only use erase() with an iteratorvector<Foo*>::iterator it = tehList.begin();delete *(it[2]);tehList.erase(it[2]);//tehList[2] is now what used to be tehList[3], and the old [2] was deallocated.Foo* aFoo = tehList[0];//it's an array of foo pointers//before doing delete tehList, you have to make sure all its elements were//deleted too.