STL
-
Hi, I have a vector object that has some elements in it and I want to remove an item completly from the vector. Here is what I mean, vector inV; for (i=0; i<10; i++) inV.push_back(i); I would like to call a function that will remove one of the items and leave me with 9 elements in the vector. I tried using remove(...), but that doesn't do what I want. If I use remove, I have to copy the valid elements from one vector to another and I don't really want to do that each time I have to delete an element. If this is possible please let me know. Thank in advance
-
Hi, I have a vector object that has some elements in it and I want to remove an item completly from the vector. Here is what I mean, vector inV; for (i=0; i<10; i++) inV.push_back(i); I would like to call a function that will remove one of the items and leave me with 9 elements in the vector. I tried using remove(...), but that doesn't do what I want. If I use remove, I have to copy the valid elements from one vector to another and I don't really want to do that each time I have to delete an element. If this is possible please let me know. Thank in advance
-
what about using the
std::vector::erase()
function to delete a single element or thestd::vector::clear()
function to remove 'em all?