Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

RandomAxess

STL Vector List deletion of one item?

This topic is 5227 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
If you have created what's in blah[index] with new you can delete it with delete. Otherwise you have the erase function. Look it up

[edited by - Eriond on June 3, 2004 2:15:21 PM]

Share this post


Link to post
Share on other sites
You can use std::vector::erase(). erase() accepts iterators, so if you want to remove an element based on index, you''ll have to do something like:

blah.erase(blah.begin() + index);

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!