C++ offers a simpler way: for (int num : numbers) automatically visits each element. Variable num takes each value in turn, no index needed. This syntax is cleaner when you just need values, not positions.
It works with any container, making it a flexible pattern. To modify elements, use a reference: for (int& num : numbers). The ampersand lets you change actual vector elements, not just copies.