C++ File Streams

Introduction

We can read from a file, and we can write to a file.

The standard-library offers such functionality via file streams.

Those files streams are defined inside the <fstream> header, and they are:

  • std::ifstream - read from a file
  • std::ofstream - write to a file
  • std::fstream - read from and write to a file

The std::fstream can both read from and write to a file.




PreviousNext

Related