I'm reading one tutorial about STL iterators. I've noticed that there is iterator support for strings. For example I can do something lke this:
I wonder what is the benefit of using iterators with strings (there must be some benefit otherwise iterators wouldn't have been defined)?Code:#include <iostream> #include <string> using namespace std; int main() { string s("Kivla"); string::iterator it; for (it = s.begin(); it != s.end();++it) { cout<<*it; } }
In which cases they are useful for strings?
- Micko