C++ 文本读写

写文件:

    ofstream of;
    of.open("test.txt");    
    string content = "abcd";
    of.write(content.c_str(),content.length());
    of<<endl;
    of<<"1234";
    of.close();

读文件:

posted @ 2015-05-13 08:45  扑通  阅读(119)  评论(0编辑  收藏  举报