Skip to content

Glossary: C++ Basics

std::ifstream and std::ofstream

Also written: std::ifstream, std::ofstream, fstream, file stream

File streams from `<fstream>`: `std::ifstream` reads a file and `std::ofstream` writes one. They close the file by themselves when they go out of scope.

Where the book teaches it

Related terms

RAIIstd::ostream