ofstream 默认是以输出方式打开文件,若文件不存在,则自动创建
对程序来说 把文件导入程序 就是以输入方式打开文件, 把内容写到文件中就是以输出方式打开文件
string num = "3efe15fef51sf15";
ofstream config("write.txt");//ofstream是从内存到硬盘
config << "haar: "<< num<<std::endl;//注意:最后必须有endl才行,否则无法写入。
ofstream 默认是以输出方式打开文件,若文件不存在,则自动创建
对程序来说 把文件导入程序 就是以输入方式打开文件, 把内容写到文件中就是以输出方式打开文件
string num = "3efe15fef51sf15";
ofstream config("write.txt");//ofstream是从内存到硬盘
config << "haar: "<< num<<std::endl;//注意:最后必须有endl才行,否则无法写入。