linux & C++Primer 学习笔记--fstream 非常好用的文件操作流

    技术2022-05-20  32

    2011-03-02

    15:40:25

     

    习惯了window下的file CFile 模式的文件操作. 今天发现一个很好用的流文件操作。fstream

     

    #include <fstream> using namespace std; int main() { fstream cstr; cstr.open("able", ios::out | ios::app); cstr << "hello useful fstream" << endl; cstr.close(); return 0; }

     

    make 以后就可以在当前目录生成一个文件able。

     


    最新回复(0)