/*
* @topic T0M320 Reverse string demo Spring 2017
* @brief C++ reverse characters using std::string and std::reverse
*/
#include <iostream>
#include <cstdlib>
#include <string>
#include <algorithm>
using namespace std; // allows cout instead of std::cout
int main()
{
string input;
while (
cout << "enter a string: ",
getline( cin, input ) // get entire line of input with spaces
)
{
// using standard library algorithm
reverse( input.begin(), input.end() );
cout << "reversed string is\n" << input << "\n";
}//while
system( "pause" );
return 0;
}