void strRev(char *s)
{
char temp, *end = s + strlen(s) - 1;
while( end > s)
{
temp = *s;
*s = *end;
*end = temp;
end--;
s++;
}
}
C语言实现字符串反转
最新推荐文章于 2025-02-04 00:15:00 发布
void strRev(char *s)
{
char temp, *end = s + strlen(s) - 1;
while( end > s)
{
temp = *s;
*s = *end;
*end = temp;
end--;
s++;
}
}