#include #include #include #include //From http://www.richelbilderbeek.nl/CppCoutContainer.htm template void CoutContainer(const Container& c) { std::copy(c.begin(),c.end(),std::ostream_iterator(std::cout,"\n")); } int main() { //Create a vector std::vector v; v.push_back(1); v.push_back(4); v.push_back(9); v.push_back(16); v.push_back(25); //Show it on screen using CoutContainer CoutContainer(v); }