cant use j as an iterator?

here is the code:
1
2
3
4
5
6
7
8
9
10
11
for( std::size_t i = 0 ; i < monsters.size(); i++)
{
	for( std::size_t j = 0; j < bullets.size(); j++ );
	{
		if( monsters[i]->IsHit( bullets[j]->xPos, bullets[j]->yPos ) )
		{
			delete bullets[j];
			bullets.erase( bullets.begin() + j );
		}
	}
}



E: nevermind i found the problem. I accidentally put a ';' after the for loop

Last edited on
Trivia, I don't think you need std:: before size_t. It should be a macro which expands to unsigned long int and macros aren't bound to namespaces.
Topic archived. No new replies allowed.