#include <iostream>
int getstrlength(const char *a)
{
if(a==NULL)
{
return 0;
}
int i=0;
while(a[i] != '\0')
{
i++;
}
return i;
}
void reverse(const char * a,char *&b)
{
int a_length = getstrlength(a);
b = new char[a_length+1];
for(int i=0;i<a_length;i++)
{
b[i]=a[a_length-i-1];
}
b[a_length] = '\0';
}
void main()
{
char a[]="0123456789";
char*b;
//char b[20]={0};
reverse(a,b);
int b_length = getstrlength(b);
for(int i=0;i<b_length;i++)
{
std::cout<<b[i];
}
delete[] b;
return;
}