//OrinTill Qimid CS1A Chapter 4, P. 294, 10
//
/**************************************************************
 * Reverse names
 * 
 * ____________________________________________________________
 *This program will reverse the name given.
 * ____________________________________________________________
 * INPUT
 * User name.
 * OUTPUT
 * Reversed name
 **************************************************************/
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
char* reverse(char* string, int size)
{
    int length = strlen(string);
    char* array = new char [length];
    for (int i = 0; i < length; i++)
    {
        array[i] = string [length-1-i];
    }
    return array;
}

int main() 
{
    int size = 100;
    char* string = new char [size];
    char* re;
    cout<<"What would you like to enter?"<<endl;
    cin.getline(string, size);
    re = reverse(string, size);
    cout<< re <<endl;
    delete [] string;
    delete [] re;


}