TITLE: Discarding characters using cin PROBLEM: rcf@tunica.eel.ufl.edu (Robert Charles Fellenz) If the following statements are in my program, how do I flush the the "cin" buffer if a user inputs more than ten integers (separated by spaces) for the loop with the "cin" statement. [ Sorry, I missed the original code. But it is not needed to understand the response below. -adc ] RESPONSE: steve@taumet.com (Steve Clamage), 25 Sep 1992 Use the function istream::ignore(int count, int delim=EOF) It extracts and discards characters until - 'count' characters are extracted, - the character 'delim' is encountered, - the end of file is reached, whichever occurs first. If 'delim' is EOF (the default), exactly 'count' characters will be discarded (unless end of file is reached). To discard the remainder of a line, use cin.ignore(MANY, '\n'); where 'MANY' is INT_MAX is from , or is some positive number that fits in an int and is bigger than the length of any line.