Answers for "how to traverse string in c++gfg"

C++
1

traverse through a string cpp

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 August-17-2021

Browse Popular Code Answers by Language