, , . , , .. ( )
for (auto &c : s){
c = toupper(c);
}
the link refers to the same unique variable. With each iteration of the loop, you get a new link to the next element in s.
What you cannot do with the link really changes what it refers to, for example:
int i = 10;
int j = 20;
int& h = i;
h = j;
Jbl source
share