My files are not seeming to open properly. I need to open and read scores.txt, and then I need to open and write to stats.txt. I'm not seeing what Im doing wrong.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
ifstream fin ("stats.txt");
ofstream fout ("scores.txt");
fin.open("scores.txt");
if (fin.fail())
{
cout << "Cannot open file to read ( scores.txt )" << endl;
exit(1);
}
fout.open("stats.txt");
if (fout.fail())
{
cout << "Cannot open file to read ( stats.txt )" << endl;
exit(1);
}