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

2011-03-02

15:40:25

 

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

 

#include 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。

 

你可能感兴趣的:(linux,C++)