ifstream fis("ReadMe.txt");
if(fis.fail()){
exit(1);
}
ofstream fos("test2.txt");
string s;
while( getline(fis,s) )
{
cout << "Read from file: " << s << endl;
fos<<s;
fos<<endl;
}
fis.close();
fos.close();
if(fis.fail()){
exit(1);
}
ofstream fos("test2.txt");
string s;
while( getline(fis,s) )
{
cout << "Read from file: " << s << endl;
fos<<s;
fos<<endl;
}
fis.close();
fos.close();