Skip to main content
gamedev.net
๐Ÿ”’ Locked

erasing a random element from vector

Started by browny Jun 10, 2006 at 12:15 PM 0 replies 450+ views
Original Post
browny
browny
Hey, how do i delete an item from a vector... array_item.erase( &array_item ) used to work in VC6.. its not working in VC8 anymore.. what is the work around ?
Z
Enigma
Enigma
array_item.erase(&array_item); 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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.