#include <stdio.h>
void reverse(char *str)
{
char *end = str;
char temp;
if(str)
{
while(*end)
end++;
--end;
while(str<end)
{
temp = *str;
*str++ = *end;
*end-- = temp;
}
}
}
int main()
{
char str[100];
printf("Input a string pls:\n");
gets(str);
reverse(str);
printf("After Reverse:\n%s\n",str);
return 0;
}