写文件
#include <fstream> using namespace std; int main() { ofstream outFile; outFile.open("D:\gaoyu.txt"); outFile << "this is a c++ file write test."; outFile.close(); return 0; }
ofstream ofs(path + "/result.txt", ios::out | ios_base::binary); string line2 = ""; line2.append(" 阈值 ").append(" tpr(1-frr) ").append(" fpr(far) ").append(" 准确率 "); ofs.write(line2.data(), line2.length()); ofs.flush(); ofs.close();