char *string_reverse(char * s)
{
int len = strlen(s);
char *head = s;
char *tail = s+len;
char *tmp = NULL;
for(i=0;i<len/2;i++)
{
*tmp = *(head+i);
*(head+i) = *(tail-i);
*(tail-i) = *tmp;
}
}
时间: 2024-10-26 21:28:05
char *string_reverse(char * s)
{
int len = strlen(s);
char *head = s;
char *tail = s+len;
char *tmp = NULL;
for(i=0;i<len/2;i++)
{
*tmp = *(head+i);
*(head+i) = *(tail-i);
*(tail-i) = *tmp;
}
}