PLEASE HELP!

I'm suppose to write a program that takes a c-string as input and then it must check if the c-string consist of a single blank space between the words, if not the program must fix that by putting a single blank space between the words. I've tried writting the program but i cannot finish it as i am clueless when it comes to testing the input c-string for a single blank space between words. please help!
Test for single blank space between words:

Look at each letter in turn.
If letter is a blank space, check that following letter is NOT a blank space.
If following letter IS a blank space, you have two (or more) blank spaces between words.
Good idea Moschops but i still don't know how to write the code for replacing multiple spaces with a single space.
so the program is suppose to change double or more blank spaces into a single black space ?
Yes Kapo.
Take a look at the string erase function. We're not going to do your homework for you :)


http://www.cplusplus.com/reference/string/string/erase/
Topic archived. No new replies allowed.