C++ Language/ProgramFlow/Loops/LoopingOverCollection
Any STL collection that provides iterators via begin()
and end()
(e.g., std::vector<int> veciVar = {0,11,22,33};
) can be iterated by for (int iItem : veciVar) { body }
.
Additional information about looping over a collection (includes interactive examples)