Answers for "for a character in a string loop c++"

C++
1

loop through char in string c++

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

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

Code answers related to "for a character in a string loop c++"

Browse Popular Code Answers by Language