Reversing every word in a string
If using C++ is an option for you (which your tags suggest), then you might consider using std::swap for swapping the characters. You might also want to use isspace to check for whitespace other than ' '.

You could also write it all in a single function:

void reverse_every_word(char* s)
{
    char* front;
    char* back;
    while(*s != '\0')
    {
        // handle whitespace
        while(*s != '\0' &amp;&amp; isspace(*s))
            s++;

        // skip to the end of the current word
        front = s;
        while(*s != '\0' &amp;&amp; !isspace(*s))
            s++;

        // reverse
        back = s-1;
        while (front &lt; back)
            std::swap(*front++, *back--);
    }
}