OT: flushing the input stream in c++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
> 




[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux