std::copy(a.begin(), a.end(), std::ostream_iterator<int>(std::cout, "\n"));
a can be any container that supplies iterators
The template parameter type on std::ostream_iterator should match the value_type on a.
Prints each element on a separate line; you can change the delimiter between elements by replacing "\n", BUT be warned: the delimiter will appear after the last element as well
The template parameter type on std::ostream_iterator should match the value_type on a.
Prints each element on a separate line; you can change the delimiter between elements by replacing "\n", BUT be warned: the delimiter will appear after the last element as well