📜  循环遍历字符串中的字符 c++ 代码示例

📅  最后修改于: 2022-03-11 14:44:57.359000             🧑  作者: Mango

代码示例1
std::string s("Hello world");

for (char & c : s)
{
    std::cout << "One character: " << c << "\n";
    c = '*';
}