Answers for "iterating string in cpp"

C++
1

iterating string in cpp

std::string s("Hello world");

for (char & c : s)
{
    std::cout << "One character: " << c << "\n";
    c = '*';
}
Posted by: Guest on May-23-2021

Browse Popular Code Answers by Language