There are 4 errors in this code, at least.
Iterator declaration is same like the vector it's going to iterate over + ::iterator at the end.
Use prefix increase (++ in front) with iterators.
You don't use at() to acess elements with iterator.
Iterator acts like a pointer -> accesses the element like through a pointer and * can dereference it like a pointer but they are not pointers.
The start value(for iterating over whole vector) should be begin().
The check should be ' iter inequal to end()'.
std::vector<sf::Sprite> vector;
...//push something into vector
for(std::vector<sf::Sprite>::iterator iter=vector.begin();iter!=vector.end();++iter)
{
iter->SetImage(asteroid);
iter->SetPosition(200.f,150.f);
...//ect.
}
This is the correct way to iterate through vectors and few other stl containers.