有返回,只是你在n没有值,for循环无法执行,加一行n=strlen(x);
#include <stdio.h>
#include <string.h>
void main()
{
char s[60];
void f(char *x,int n);
gets(s);
f(s,strlen(s));
printf("%s",s);
}
void f(char *x,int n){
char t;
int i;
for(i = 0;i < n/2;i++){
t = x[i];
x[i] = x[n-1-i];
x[n-1-i] = t;
}
}
char s[60];
f(char *x,int n);