For Each Statement
#include <iostream> int main() { // This form of the for loop goes through a list of items. // Also very useful for arrays, when we get there. for(int i: { 4, 5, 19, 3, 55, 6 }) { std::cout << "[" << i << "] "; } std::cout << std::endl; }

This list form of a for loop has been part of the language starting with the 2011 standard. As with other types of for loop, it is most useful with arrays.