Hello all, yes yet again an Assignment problem I need help with haha ;) Anyways this time my code is correct, I think, but I am getting hung up on an ifstream issue. Here is the code:
ifstream infile;
ofstream outfile;
infile.open("C:\Users\***\Desktop\School\chapter5.txt");
if (!infile)
{
cout << "Cannot open the infile!" << endl;
cout << "Terminate Program!" << endl;
return 1;
}
outfile.open("C:\Users\***\Desktop\School\chapter5.txt");
outfile << fixed << showpoint << setprecision(2);
cout << "Processing data" << endl;
infile >> acctNumber >> begBalance;
Now I get successful builds, but all I see is the:
Cannot open the infile!"
Terminate Program!
Press Any Ket to Continue.
I have tried it a few ways, at first I did not have a *.txt file available thinking this would create it, so I went and created a blank chapter5.txt file and then I tried adding data to the *.txt file in the same format they showed in the book. I will be happy to show more code if needed I just thought this would be enough and did not want to add more code than needed to the forum. Any help is appreciated, please do not post the correct code, just point me in the direction as I need to memorize this stuff, I have a module due in two weeks that needs to perform a task like this. Thanks.