Answers for "can i use iterator with a string in c++"

C++
0

string iterator in c++

// string::begin/end
#include <iostream>
#include <string>

int main ()
{
  std::string str ("Test string");
  for ( std::string::iterator it=str.begin(); it!=str.end(); ++it)
    std::cout << *it << endl;
  std::cout << '\n';

  return 0;
}
Posted by: Guest on November-21-2020

Code answers related to "can i use iterator with a string in c++"

Browse Popular Code Answers by Language