参考:
void inverse(char str[])
{char t;
int i,j;
for (i=0,j=strlen(str);
{t=str[i];
str[i]=str[j-1];
str[j-1]=t;
}
}
void reverseOutput(char *s)
{
int i,j;
char t;
for(i=0,j=strlen(s)-1;i<j;i++,j--)
{
t=s[i];
s[i]=s[j];
s[j]=t;
}
}
void reverseOutPut(char *s)
{
char t, *p, *q;
p = q = s;
while (*p) // p指针移到末尾
p++;
p--;
while (q < p)
{
t = *p;
*p = *q;
*q = t;
p--;
q++;
}
}