You will discover
that it will be necessary on occasions to "clear the output
stream". All information going "out" to the
screen goes through the output stream. (Thus the header
named <iostream.h> - input/output stream.)
To force the
information to go to the screen immediately (and not wait for more
information to enter the stream before outputting to the screen),
we will be using flush.
The correct syntax will be:
cout <<
"Flushing the output stream." << flush;
If
you are using a clear screen command (system ("CLS");)
in the middle of a program and it does not appear to be working
...
flush the cout statements which precede the clear screen command. |