Sign in to follow this  
browny

erasing a random element from vector

Recommended Posts

Hey, how do i delete an item from a vector... array_item.erase( &array_item[i] ) used to work in VC6.. its not working in VC8 anymore.. what is the work around ?

Share this post


Link to post
Share on other sites
array_item.erase(&array_item[i]); will only work for SC++L implementations that use raw pointers for their vector iterators. The more portable implementation is array_item.erase(array_item.begin() + i);.

Σnigma

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this