#include<stdio.h>标签:arr,right,函数,int,char,str,字符串,left,逆序 From: https://blog.51cto.com/u_15806064/5981198
#include<string.h>
void reverse_string(char* str)
{
//assert(arr);
int len = strlen(str);
char* left = str;
char* right = str + len - 1;
while (left < right)
{
char tmp =* left;
*left = *right;
*right = tmp;
left++;
right--;
}
}
int main()
{
char arr[562] = { 0 };
printf("变化前的:\n");
scanf("%s", arr);
reverse_string(arr);
printf("变化后的:%s\n", arr);
return 0;
}