I've declared ifstream infile in a class and use it in a method to open a txt file for reading. Once I am finished reading data from it and parsing it into two different files, I then close it in that same method. However, I cannout reuse it to open a different file in another method. My file check just states that the file does not exist for opening. Well, it does, since I just created it in the same directory. Is it possible to clear out ifstream infile from its association to the 1st file it opened. Since I don't want to introduce another variable to open another file. I like to reuse my code as mush a possible to keep it clean. Any ideas?
In the meantime, I have been using another variable for opening a file, but I ultimately want to reuse te infile.
Todd
In the meantime, I have been using another variable for opening a file, but I ultimately want to reuse te infile.
Todd