Code:
int arr[5] = { 1, 2, 3, 4, 5 }; for (auto i: arr) std::cout << "i" << "\n"; The question is why the numbering comes from one and not from scratch? Somehow it looks wrong, not to mention the fact that the cycle goes beyond the array. How to use a range-based loop for an array so that the numbering is from scratch, and not from one?