ofstream file1out("1.txt");
ofstream file2out("2.txt");
ofstream file3out("3.txt");
if ( myfile1out.is_open() && myfile1out.is_open() && myfile1out.is_open() )
{
myfile1out << "1" << endl;
myfile2out << "2" << endl;
myfile3out << "3" << endl;
myfile1out.close();
myfile2out.close();
myfile3out.close();
cout << "Saved to file 1.txt, 2.txt and 3.txt!" << endl;
}
else
{
cout << "File write error 1.txt, 2.txt and 3.txt" << endl;
}