Walk along the string, but keep a boolean variable that's true if the last character was whitespace and false otherwise. Whenever you reach a non-whitespace character and the boolean variable is true, change the character to upper case. You don't need to worry about testing if it's already upper case because toupper does the right thing regardless of the character you give it.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
>I don't quite understand.
What a surprise. Have you people even taken a problem solving course? A boolean variable is bool, it means true or false. Walk the string character by chraracter, you can do this with an int that counts from 0 to size - 1. Save whether the last character is a space. Then it's just a matter of an if statement. If this is too difficult for you then get your book out and start reading, because I really can't help you more than making the solution freaking obvious and as easy as possible.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401