// Using a for loop with iterator for(std::vector::iterator it = std::begin(v); it != std::end(v); ++it) { std::cout << *it << "\n"; }