int myArray[5] = {1, 2, 3, 4, 5}; for (auto& c : myArray) c *= 2; for (auto c: myArray) std::cout << c << " "; // 2 4 6 8 10 std::vector vecInt({1, 2, 3, 4, 5}); for (auto& c: vecInt) c *= 2; for (auto c: vecInt) std::cout << c << " "; // 2 4 6 8 10 std::string str= {"Only for Testing Purpose."}; for (auto& c: str) c=std::toupper(c); for (char c: str) std::cout << c; // ONLY FOR TESTING PURPOSE. str= {"Only for Testing Purpose."}; for (autor& c: str) c=std::isupper(c)? std::tolower(c): std::toupper(c); for (auto c: str) std::cout << c; // oNLY FOR tESTING pURPOSE