2023年8月4日 · The class template basic_fstream implements high-level input/output operations on file based streams. It interfaces a file-based streambuffer (std::basic_filebuf) with the high-level interface of (std::basic_iostream).
fstream Input/output stream class to operate on files. Objects of this class maintain a filebuf object as their internal stream buffer , which performs input/output operations on the file they are associated with (if any).
The fstream class (short for "file stream") is used to read and write into files. The fstream class is defined in the <fstream> header file. To open a file, pass the file path into the constructor: