//实现两个字符进行交换
void exchange(char&a,char&b)
{
char temp;
temp = a;
a = b;
b = temp;
}
//定义一个整形变量,作为辅助参数
int i = 0;
//实现字符串的反转
char* topos(char*p,int n)
{
exchange(p[i], p[n-1-i]);
i++;
if (int(n / 2) > i) topos(p, n);
return p;
}
int main()
{
//ito2(8);
char str[] = "123abcdefgh!!!~~~";
char *p = topos(str, strlen(str));
cout << p<<endl;
}