#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <string>

int main(int argc, char * argv[])
{
    if(1 < argc)
    {
        std::string string_to_reverse(argv[1]);

        std::cout << "before: " << string_to_reverse << std::endl;

        // doing reverse
        std::reverse(string_to_reverse.begin(), string_to_reverse.end());

        std::cout << "after: " << string_to_reverse << std::endl;

    }
    else
    {
        std::cout << "Usage: " << argv[0] << " string_to_reverse" << std::endl;
    }

    return EXIT_SUCCESS;
}



syntax highlighted by Code2HTML, v. 0.9.1