cin.ignore()

Dec 1, 2013 at 11:54pm
Hello, I am trying to avoid using the cin.ignore() function. How would I write a line(s) that does the same purpose as cin.ignore()? I know what the cin.ignore() command does but I am just trying to think of an alternative way to write it.

Thanks for any help.
Dec 2, 2013 at 12:02am
Dec 2, 2013 at 2:47am
But get() doesn't necessarily do the right thing.

The best way is to put it all in a single routine, which you call to obtain input. For example:
http://www.cplusplus.com/forum/beginner/13044/#msg62827
(These days you can get rid of the word "mutable" on line 10.)

Enjoy!
Topic archived. No new replies allowed.