Reversing an STL String : string reverse « String « C++
- C++
- String
- string reverse
Reversing an STL String
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
string strSample ("Hello String! ");
cout << strSample << endl;
reverse (strSample.begin (), strSample.end ());
cout << strSample;
return 0;
}
Related examples in the same category