C++ examples for STL:string
Decrementing string::iterator
#include <iostream> #include <string> using namespace std; int main(int argc, char *argv []) { //from w w w .j a v a2 s . c o m string myString{ "This is my string!" }; for (string::iterator iter = myString.end()-1; iter != myString.begin(); --iter) { cout << *iter << endl; } return 0; }