Header Reference: <fstream>
Header Reference: <fstream>
File stream classes and stream-based file I/O facilities from <fstream>.
Header Reference: <fstream>
File stream classes and stream-based file I/O facilities from <fstream>.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
Header reference pages are meant to answer a practical question quickly: what this header provides, when to reach for it, and which usage rules are easiest to get wrong.
<fstream>std::ifstreamstd::ofstreamstd::fstreamUse <fstream> for stream-oriented file reading and writing with the standard iostream model.
getlineis_open() or stream state when file access may fail.<filesystem> complements rather than replaces <fstream>.#include <fstream>
int main() {
// Pair stream types with state checks and explicit formatting rules.
return 0;
}