Objectives :

  • myios_flush1.cpp
    When you send output to a stream, the stream is supported with a buffer and which may not trigger printing immediately. Buffering allows to spool a large amount of output, facilitate the printer to keep page formatting.

    Forcing all buffered contents  to actually be printed or displayed the output on a screen, is known as "flushing" the stream. A flush can be forced by calling the flush function associated with each output stream.
     for(int i=0; i < 4; i++)
    myFile12<<": Adding text "<< i <<" " <<flush;

  • code: myios_flush1.txt

Step: 1 Create a source file.

Step: 2 Edit and save Source file

Step: 3 Runtime Views: