Code tagged with print

Print Container

Posted by Jorden Mauro over 2 years ago
Prints the contents of a container to the console.
template void printContainer(const C& c)
{
   typename C::const_iterator it(c.begin());
   while (it!=c.end()-1){
      std::cout<<*it++<<", ";
   }
   std::cout<<*it;
}
Language C++ / Tagged with print, container