Код: Выделить всё
&Код: Выделить всё
&Этот код изменяет переменную «a».
Код: Выделить всё
#include
#include
int main() {
std::string a = "HELLO";
for (char &x : a) {
x = tolower(x);
}
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79674276/c-range-based-for-loop-how-can-modify-other-variable[/url]
Мобильная версия