Hi,

Im trying to remove an element from a vector inside a loop using an iterator, which it seems I am doing incorrectly.

Code:
		for(vector<bomb>::iterator bm = bombs.begin(); bm!=bombs.end(); ++bm)
		{
		    ....
                    bombs.erase(bm);
		}
Looking around it seems this fails (it gives a segmentation fault) because i am using an invalidated iterator, but im not sure how to correct this?

Thanks for any help.

Jack