If you want to modify the content of the array you need a reference. Currently you modify a copy.
1 2 3 4 5 6 7 8 9
#include <iostream>
int main(void) {
int a[] = { 1, 2, 3, 4, 5 };
for (int &i : a) // Note: &
i += 10;
for (int i : a)
std::cout << i << ' ';
return 0;
}