// writing on a text file #include <iostream> #include <fstream> using namespace std; int main () { ofstream myfile ("example.txt"); myfile << "This is a line. "; myfile << "This is another line. "; myfile.close(); return 0; }