OT: flushing the input stream in c++
Gregory Nowak
greg at romuald.net.eu.org
Thu Sep 5 17:36:03 EDT 2002
This has actually worked for me.
cout << "Press enter to continue.";
cin.ignore(1, '\n');
cout << "Done.\n";
Greg
On Thu, Sep 05, 2002 at 02:36:20PM -0500, William Hubbs wrote:
> Hi Kirk and all,
>
> I guess I should have written out c plus plus instead of using the plus
> sign, sorry about that.
>
> Attached is a very short program that shows what I am trying to do. I
> want the pressenter() function to be able to be sure that there is
> nothing on the input stream before it prints the "press enter to
> continue" message.
>
> Is there a way to see how many characters are on the input stream so I
> know what number of characters to pass to cin.ignore()?
>
> William
>
More information about the Speakup
mailing list