fstream、ifstream、ofstream是c++中关于文件操作的三个类
打开文件
fstream fs("要打开的文件名",打开方式); 或者 fstream fs; fs.open("要打开的文件名",打开方式);
例子:
关于fstream、ifstream、ofstream读写文本文件、二进制文件详解
原文:https://www.cnblogs.com/smallredness/p/9245353.html