C++ 写入文本文件 (txt) 的代码示例
#include
int main() { ofstream fout('example.txt'); if (!fout) { cout << 'Error: cannot open file!' << endl; return 1; } fout << 'Hello world!' << endl; fout.close(); return 0; }
原文地址: https://www.cveoy.top/t/topic/nF0Y 著作权归作者所有。请勿转载和采集!