#include using namespace std; int main() { ofstream outfile("example.txt", ios::app); if (outfile.is_open()) { outfile << "This is a new line.\n"; outfile.close(); } else cout << "Unable to open file" << endl; return 0; }
标签:std,main,模式,outfile,追加,ofstream From: https://www.cnblogs.com/hshy/p/17573329.html