I want to print out the contents of a vector in C++, here is what I have:
#include #include #include #include
In C++11, a range-based for loop might be a good solution:
vector items = {'a','b','c'}; for (char n : items) cout << n << ' ';
Output:
a b c