one way is to read word by word into a vector of words, and put the spaces back yourself.
otherwise you can search for 2 spaces and replace with 1 via find() and erase functions, but you would have to do that in a loop until it didnt find any more to do. this is probably the worst approach I am offering; its on par with using a text editor to replace space space with space over and over.
and a third way is to copy letter by letter into a new string, skipping extra spaces.
you may have additional rules like space punctuation. If you want those, you probably want method #3.
and finally you can probably do it all in 2 lines with some difficult to follow string magic functions, but I am not quite there yet in cooking those up. Someone will offer one of those shortly, I am sure :)