Connecting Tech Pros Worldwide Help | Site Map

spaces handling while reading input from a file

coinjo
Guest
 
Posts: n/a
#1: Dec 30 '05
while reading a sentence from a file, how can i recognize that a space
has been read so if i output the sentence again, i could still print
the space again?

Jacek Dziedzic
Guest
 
Posts: n/a
#2: Dec 30 '05

re: spaces handling while reading input from a file


coinjo wrote:[color=blue]
> while reading a sentence from a file, how can i recognize that a space
> has been read so if i output the sentence again, i could still print
> the space again?[/color]

Use std::getline() instead of operator>>.

HTH,
- J.
Closed Thread