Originally Posted by
ZuK
two possibilities
either remove lines 10 & 11 and add the openmode to the constructor in line 8
or remove line 8
Kurt
My code is:
Code:
ifstream e_file ( "D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_Frequencies.txt" );
if (!e_file )
{
cout << "Can't open input file" << " Highest_Frequencies.txt " << endl << endl;
cin.get();
exit(1);
}
ofstream f_file ( "D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_Frequencies.txt" );
ofstream out1;
out1.open("D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_Frequencies.txt", std::ios::app);
ofstream out2("D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_Frequencies.txt", std::ios::app);
if (! f_file )
{
cout << "Can't open input file " << endl << endl;
cin.get();
exit(1);
}
//cout << "Mega_Money's 4 lowest numbers are:" << endl << endl;
f_file << indexofone << " = " << one << " " << indexoftwo << " = " << two << " " << indexofthree << " = " << three << " " << indexoffour << " = " << four;
If I:
Code:
// ofstream f_file ( "D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_Frequencies.txt" );
ofstream out1;
out1.open("D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_Frequencies.txt", std::ios::app);
ofstream out2("D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_Frequencies.txt", std::ios::app);
I get the following errors:
Code:
Error 1 error C2065: 'f_file' : undeclared identifier 249
Error 2 error C2065: 'f_file' : undeclared identifier 257
Error 3 IntelliSense: identifier "f_file" is undefined 249
If I:
Code:
// ofstream f_file ( "D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_Frequencies.txt" );
ofstream out1;
out1.open("D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_Frequencies.txt", std::ios::app);
// ofstream out2("D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_Frequencies.txt", std::ios::app);
I still get the same errors. I'm confused. Where exactly in my code do I put the append code?