用C++实现void reverse(char* str)函数,即反转一个null结尾的字符串.

void reverse(char* str)
{
    char *end = str, *begin=str;
    char temp;
    while(*end!='')
    {
        end++;
    }
    end--;
    while(begin<=end)
    {
        temp = *end;
        *end-- = *begin;
        *begin++ = temp;
    }
}
原文地址:https://www.cnblogs.com/crazycodehzp/p/3731255.html