反转
#include <stdio.h>
#include<string.h>
char* str_reverse(char* str)
{
int n = strlen(str) / 2;
int i = 0;
char tmp = 0;
for(i = 0; i < n; i++)
{
tmp = str[i];
str[i] = str[strlen(str)-i-1];
str[strlen(str)-i-1] = tmp;
}
return str;
}
int main()
{
char s[] = "hello world!";
printf("%s", str_reverse(s));
return 0;
}