vector v; v.push_back(\"A\"); v.push_back(\"B\"); v.push_back(\"C\"); v.push_back(\"D\"); for (vector::iterator it = v.begin(); it!=v.end()
With a normal ostream_iterator, you'll get a comma after every data item -- including the last, where you don't want one.
I posted an infix_iterator in a previous answer that fixes this problem, only putting commas between the data items, not after the final one.
infix_iterator