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。