Im working on this program: to write a program that displays the last 10 characters in an order that is reverse of the order they were entered... i've gotten this so far:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string message;
cout << " Enter a string that is longer than 20 characters:\n " << endl;
getline(cin, message);
cout << endl;
cout << " The string backwards is:\n " << endl;
cout << endl;
string::reverse_iterator rit = message.rbegin();
while (rit != message.rend())
{
cout << *rit++;
}
cout << endl;
}
this just displays the the message backwards...what do i need to do to make it display that last 10 characters of the orginal message backwards.. can anyone help?