Mega Code Archive
Use a reverse iterator to display the string in reverse
#include
#include
#include
#include
#include
using namespace std;
int main()
{
string strA("This is a test.");
string::reverse_iterator ritr;
for(ritr = strA.rbegin(); ritr != strA.rend(); ++ritr)
cout << *ritr;
return 0;
}