View Single Post
Old Oct 27th, 2005, 7:07 PM   #29
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
cin.clear () repairs the broken stream. It does NOT remove any characters that were left in the stream, unconsumed. Add cin.sync () for that. You can use things like getch if you're satisfied with producing non-portable code when there's no need for it. Seems like a bad idea, though.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote