I want to print out the contents of a vector in C++, here is what I have:
#include #include #include #include
This answer is based on the answer from Zorawar, but i couldn't leave a comment there.
You can make the auto (C++11)/typedef version const by using cbegin and cend instead
for (auto i = path.cbegin(); i != path.cend(); ++i) std::cout << *i << ' ';