Can anyone tell me how to clear the entire input stream when you have used cin.get(etc.). I have been using cin.clear but that it only clearing the fail bit.
Thanks.
Can anyone tell me how to clear the entire input stream when you have used cin.get(etc.). I have been using cin.clear but that it only clearing the fail bit.
Thanks.
Header File
stdio.h
Category
Input/output Routines
Syntax
#include <stdio.h>
int fflush(FILE *stream);
Description
Flushes a stream.
If the given stream has buffered output fflush writes the output for stream to the associated file.
The stream remains open after fflush has executed. fflush has no effect on an unbuffered stream.
Return Value
fflush returns 0 on success. It returns EOF if any errors were detected.
try that...
Regards,
matheo917
or to be simple ...
right after the "cin" you put...
cout << endl;
--- which flushes the buffer....
or maybe you are looking to flush every single stream????
Regards,
matheo917