![]() |
CITS2002 Systems Programming |
← prev | next → | ![]() |
![]() |
|||
File streamsFile handling in C++ works almost identically to terminal input/output. To use files, we #include <fstream<> and then access two standard classes from the std:: namespace:
Each open file is represented by a separate ifstream or an ofstream object. You can use ifstream objects in exactly the same way as cin and ofstream objects in the same way as cout, except that you need to declare new objects and specify what files to open.
CITS2002 Systems Programming, Lecture 23, p13, 17th October 2023.
|