Objectives :

  • myfstream_readtext1.cpp
    • Streaming:  Both ifstream and ostream are embedded in fstream class
      • fstream : It is derived from iostream stream class with read/write or input/output abilities. This class also creates and attaches a filbuf buffer object.
        • ofstream : Stream class to output/write to a file.
        • ifstream : Stream class to input/read from a file
    • fstream eof
  • Code : myfstream_readtext1.txt

Step: 1 Create a source file.

Create a text file

Step: 2 Edit and save Source file

Step: 3 Runtime Views: