Because you're forever adding entries to the vector.
When you get to any odd number, you add it to the end of the vector, thereby increasing the size of the vector.
edit: Struck out "the end of".
Last edited on
Oh thank you all, so I would need to do iter += 2;
to fix it. Thank you guys