Google Code University\'s C++ tutorial used to have this code:
// Description: Illustrate the use of cin to get input // and how to recover from errors. #in
use cin.ignore(1000,'\n') to clear all of chars of the previous cin.get() in the buffer and it will choose to stop when it meet '\n' or 1000 chars first.
cin.ignore(1000,'\n')
cin.get()
1000 chars