C++写入txt文件方法

  1. 用ofstream 输出流,
    #include <fstream>

    ofstream outf; 
    outf.open("abc.txt");
    outf<<123<<endl;
    outf.close();

你可能感兴趣的:(C++,txt,C语言,输出流,fstream)