One possible solution- Write a string reversal routine, and pass the entire string to it, so that "This is a string" becomes "gnirts a si sihT" Then pass individual word to the above routine, (with the help of strtok), so that "gnirts" becomes "string", "a" becomes "a", "si" becomes "is" and "sihT" becomes "This".