Sorry to be such a dummy, but exactly where would you put:
to append my file? My code is:Code:ofstream out1; out1.open("D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_Frequencies.txt", std::ios::app);
ifstream e_file ( "D:\\1_LotteryPrograms\\1_Fla_Mega_Money\\Highest_ Frequencies.txt" );
Right now, the file gets erased instead of being up-dated/appended.Code: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); if (! f_file ) { cout << "Can't open input file " << endl << endl; cin.get(); exit(1); } cout << "Mega_Money's 4 highest numbers are:" << endl << endl; f_file << indexoffirst << " = " << first << " " << indexofsecond << " = " << second << " " << indexofthird << " = " << third << " " << indexoffourth << " = " << fourth;



LinkBack URL
About LinkBacks



