C++ 文本读写

时间:2015-05-13 09:56:02   收藏:0   阅读:152

写文件:

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

读文件:

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!