Using copy
and ostream_iterator
:
#include
#include
#include
#include
int main()
{
std::vector numbers{1.0, 2.1, 3.2};
std::stringstream output;
std::copy(numbers.begin(), numbers.end(), std::ostream_iterator(output, " "));
std::cout << output.str() << std::endl;
}