string::rbegin and string::rend



// string::rbegin and string::rend
#include <iostream>
#include <string>
using namespace std;

int main ()
{
  string str ("now step live...");
  string::reverse_iterator rit;
  for ( rit=str.rbegin() ; rit < str.rend(); rit++ )
    cout << *rit;
  return 0;
}
 


The actual output is:

...evil pets won

posted on 2014-02-19 20:41  长木Qiu  阅读(391)  评论(0编辑  收藏  举报