标签:
#include <stdio.h>
#include <string.h>
char reserve_string(char *string)
{
int len = strlen(string);
if(len <= 1)
return 0;
else
{
char tmp = string[0];
string[0] = string[len -1];
string[len - 1] = ‘\0‘;
reserve_string(string + 1);
string[len - 1] = tmp;
}
}
int main()
{
char a[] = "evol";
reserve_string(a);
printf("%s\n",a );
return 0;
}
标签:
原文地址:http://blog.csdn.net/yangrujing/article/details/45647173