In line 6 you are making a copy yourself :) You take the value of iter, store it in word and then change it, but you never change the original strings in the vector.
I see, the = operator does a copy. Very interesting!
Correct, I just prefer a temp variable...
Well, there's nothing wrong with having a preference. Though I saw it as clutter, my preference is to keep the code simple, direct and to the point.
References to the rescue!
std::string& word = *iter;