1、要进行文件输出操作首先需要包含头文件#include <fstream>
3、建立ofstream对象,如ofstream outfile;
5、利用outfile对象把希望输出到文件中的数据输出到文件myfile.txt中。