can anyoe tell me whats wrong with this and if im on the right track. i need to make a program that displays a piece of advice to the user when they run the program. then it allows them to add some advice to the file and then it ends. the next time it runs it allows the next person toa dd more advice after it display the old advice. get it. heres what i have so far. plz give me some psuedocode to get me going.
Code:
// This program will allow the user to add advice to a file
// already made by the programmer
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
void editfile (ifstream& in_stream, ofstream& out_stream);
int main()
{
ifstream advFileIn;
ofstream advFileOut;
cout << "Welcome to advice master. "<<endl;
advFileIn.open("advice.txt");
if (advFileIn.fail())
{
cout << "Error opening file"<<endl;
cout << "Program is terminating"<<endl;
exit(1);
}
advFileOut.open("outadvice.txt");
if (advFileOut.fail())
{
cout << "Error opening file"<<endl;
cout << "Program is terminating"<<endl;
exit(1);
}
editfile(advFileIn, advFileOut);
return 0;
}
void editfile(ifstream& in_stream, ofstream& out_stream)
{}
NOTE this is not homework.