Connecting Tech Pros Worldwide Help | Site Map

spaces handling while reading input from a file

  #1  
Old December 30th, 2005, 09:15 AM
coinjo
Guest
 
Posts: n/a
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?

  #2  
Old December 30th, 2005, 11:35 AM
Jacek Dziedzic
Guest
 
Posts: n/a

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