Next time use code tags [code] // put the code here [/code]
The two streams are local to Open_Files() function, so they are immediately closed as soon as that function terminates. What you want to do is pass the stream by reference as parameters to that function
void Open_Files(ifstream& inFile, ofstream& outFile)
The similar fix for Close_Files() function. And the function you posted is 100% wrong.
void Close_Files(ifstream& inFile, ofstream& outFile)
{
inFile.close();
inFile.clear();
outFile.close();
outFile.clear();
}
Now down in main() you have to add parameters to the above two functions.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343