C++

Objectives :

  • myfile_fflush1.cpp
    The fflush function of <cstdio> library, forces to write the contents of a buffer to a file. 
  • Code: myfile_fflush1.txt
 

Step: 1 Create a source file.

Create a blank text file

Step: 2 Edit and save Source file

Step: 3 Runtime Views: There are  two fflush operations, the illustration below shows the first operation alone, to demonstrate the write with fflush function and the contents of the text file.

A) test run 1:

Note the print out from the file

The content in the text files, confirms the above event.

Step: Run Time view with complete code , overwriting the existing text.