I have an assignment which will pull data from Trans.data and Lawn.data. Can I not use fin to open both the files at once or do i need to setup another stream. Here is my code I am getting the Error message I have set if Trans.data fails to open.
int main()
{
//set ofstream and fstream to fin and fout
ifstream fin;
ofstream fout;
//open input streams and output stream
fin.open ("Lawn.data");
if (fin.fail())
{
cout << "Error opening Lawn.data";
exit(1);
}
fout.open ("Report.out");
if (fout.fail())
{
cout << "Error opening Report.out";
exit(1);
}
ProcessLawnData(fin);
fin.close();
fout.close();
}