Answers for "how to iterate throguh a string in c++"

C++
1

how to iterate throguh a string in c++

void print(const std::string &s)
{
    for (std::string::size_type i = 0; i < s.size(); i++) {
        std::cout << s[i] << ' ';
    }
}
Posted by: Guest on July-22-2020

Code answers related to "how to iterate throguh a string in c++"

Browse Popular Code Answers by Language