The simplest way is to use standard algorithm std::reverse_copy
std::reverse_copy( input.begin(), input.end(), std::ostream_iterator<char>( std::cout ) ):
std::cout << std::endl;
It is the simplest way because you will not make a mistake in the control statement of the loop.:)
EDIT: I forgot to point out that you can use also algorithm std::copy.
std::copy( input.rbegin(), input.rend(), std::ostream_iterator<char>( std::cout ) );
std::cout << std::endl;
Also you can use a temporary object. For example
std::cout << std::string( input.rbegin(), input.rend() ) << std::endl;
if to use a loop then the correct loop will look
for ( std::string::size_type i = input.size(); i != 0; )
{
std::cout << input[--i];
}
std::cout << std::endl;
or
for ( std::string::size_type i = input.size(); i != 0; --i )
{
std::cout << input[i - 1];
}
std::cout << std::endl;