char* str_rev (char * string)
{
char *start = string;
char *left = string;
char ch;
while (*string++) {}; /* find end of string */
string -= 2;
while (left < string)
{
ch = *left;
*left++ = *string;
*string-- = ch;
}
return start;
}
不借助库函数 字符串逆转
最新推荐文章于 2022-12-23 22:47:32 发布