I want to print out the contents of a vector in C++, here is what I have:
#include #include #include #include
Just copy the container to the console.
std::vector v{1,2,3,4}; std::copy(v.begin(),v.end(),std::ostream_iterator(std::cout, " " ));
Should output :
1 2 3 4