// This program writes data to a file.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream outputFile;
outputFile.open("demofile.txt");
cout << "Now writing data to the file.\n";
// Write four names to the file.
outputFile << "Bach\n";
outputFile << "Beethoven\n";
outputFile << "Mozart\n";
outputFile << "Schubert\n";
// Close the file
outputFile.close();
cout << "Done.\n";
return 0;
}
IC8vIFRoaXMgcHJvZ3JhbSB3cml0ZXMgZGF0YSB0byBhIGZpbGUuCiAjaW5jbHVkZSA8aW9zdHJlYW0+CiNpbmNsdWRlIDxmc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKQp7CiAgb2ZzdHJlYW0gb3V0cHV0RmlsZTsKICBvdXRwdXRGaWxlLm9wZW4oImRlbW9maWxlLnR4dCIpOwoKIGNvdXQgPDwgIk5vdyB3cml0aW5nIGRhdGEgdG8gdGhlIGZpbGUuXG4iOwogCiAvLyBXcml0ZSBmb3VyIG5hbWVzIHRvIHRoZSBmaWxlLgogIG91dHB1dEZpbGUgPDwgIkJhY2hcbiI7CiBvdXRwdXRGaWxlIDw8ICJCZWV0aG92ZW5cbiI7CiBvdXRwdXRGaWxlIDw8ICJNb3phcnRcbiI7CiBvdXRwdXRGaWxlIDw8ICJTY2h1YmVydFxuIjsKCiAvLyBDbG9zZSB0aGUgZmlsZQogb3V0cHV0RmlsZS5jbG9zZSgpOwogY291dCA8PCAiRG9uZS5cbiI7CiByZXR1cm4gMDsKIH0=