//All Rights Reserved
#include <stdio.h>
#include <string.h>
void string_reverse(char s[])
{
int c, i, j;
for (i=0, j=strlen(s)-1; i<j; i++, j--)
{
c = s[i];
s[i] = s[j];
s[j] = c;
}
}
int main()
{
char s[]="hello world!";
string_reverse(s);
for (int i=0; i<sizeof(s)-1; i++)
printf("%c", *(s+i));printf("\n");
return 0;
}
string reverse
最新推荐文章于 2024-05-29 17:12:24 发布