cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Function to print STL
Function to print STL
Aug 30, 2012 at 7:27pm UTC
navderm
(93)
Hi All,
everytime I have to print out the vlaues in the STL. I end uup either using BOOST_FOREACH, or iterators or jsut counters.
Is there a function, whether in boost or STL which can help me print with a single function call
either
STL.printVals();
or
printVals (STL);
Thanks.
Neeraj
Aug 30, 2012 at 7:35pm UTC
vlad from moscow
(6539)
What are you going to print out?
Aug 31, 2012 at 7:08am UTC
majidkamali1370
(241)
create a template function in a header file that prints elements of STL containers. use iterators in it.
Then call this fuunction every time you want to print elements.
Print(STL_Container);
Topic archived. No new replies allowed.