Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

loop through char in string c++

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

for (char & c : s)
{
    std::cout << "One character: " << c << "
";
    c = '*';
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #loop #char #string
ADD COMMENT
Topic
Name
7+4 =