<pre name="code" class="cpp">编写一个函数reverse_string(char * string)
实现:将参数字符串中的字符反向排列。
要求:不能使用C函数库中的字符串操作函数。
#include <stdio.h>
int reverse_string(char * string)
{
if(*(++string)!='\0')
{
reverse_string(string);
}
printf("%c",*(string-1));
}
int main()
{
char *p="asdfghjkl";
reverse_string(p);
printf("\n");
return 0;
}