for (deque<Bullet>::iterator it = deqBullet.begin(); it != deqBullet.end(); it++) { ... }
Why won't this work? I tried breaking it up, and still nothing.
deque<Bullet>::iterator it;for (it = deqBullet.begin(); it != deqBullet.end(); it++) { ... }
My errors are:
Error 8 error C2440: 'initializing' : cannot convert from 'std::_Deque_iterator<_Ty,_Alloc,_Secure_validation>' to 'std::_Deque_iterator<_Ty,_Alloc,_Secure_validation>' Error 9 error C2679: binary '=' : no operator found which takes a right-hand operand of type 'std::_Deque_iterator<_Ty,_Alloc,_Secure_validation>' (or there is no acceptable conversion) Error 10 error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::_Deque_iterator<_Ty,_Alloc,_Secure_validation>' (or there is no acceptable conversion)
I am very inexperienced with containers and algorithms (next semester), but I am trying to muscle this one in. I do okay with vectors, but this piece of the game wouldn't work with a FILO container. Any suggestions for a better way to do an array of bullet objects (that are deleted once they are out of bounds) would be appreciated as well. Thank you,
Dan
Edit: Sorry the post came out so wide, I didn't see a way to restrict some type of word-wrap for the code.