(1) Reverse the string char by char. This is easy.
(2) Reverse each word. You need to find the start and end positions of each word.
This algorithm scans the string twice, and should be fast enough.
It is possible to scan the string only once, but the algorithm sounds more complicated to me.