fstream、ifstream、ofstream是c++中关于文件操作的三个类
打开文件
fstream fs("要打开的文件名",打开方式); 或者 fstream fs; fs.open("要打开的文件名",打开方式);
例子: