Im trying to do this in dev c++
Im basically open a large list which contains filenames to parse
and store the results.
Now what im trying to do here is to open an close a file in order to be able to "parse" a number of files (which are saved in a list)
It looks like it should work right? well when I try to open the a_file for a second time, the program crashes. thats why I added a_file.clear but it doesnt work. is there a way to use an ifstream with 2 diferent files without crashing? how do you actually close a filestream?
ifstream l_file("list.txt"); //text containing list of files.
ifstream a_file; //the file to be parsed
ofstream b_file("final.txt"); //file which will be filled with the result
while (!l_file.eof()) //open the file list
l_file>>fname; //send the file to the filename
a_file.open(fname); //open the text containing emails
b_file<<parseline(str)<<endl; //save the parsed data
oh yeah, the list contains the same file like this
so is not a file missing problem.
sorry, fixed that.
Sorry first time here, I used the code tag now . :D
Now what can I do to close the ifstream?