Advertisement

reading in multiple files

Started by August 04, 2000 05:28 PM
1 comment, last by omegasyphon 24 years, 4 months ago
my question is how do i read in 2 seperate files in one function when i do this ifstream fin("map.txt"); ifstream fin("map2.txt"); i get an error on the second one and i dont know why?
When you''re done withe the first file just do this:

fin.close();

And then do:

fin.open("file2.txt");

I think this should do it.
Advertisement
You''re trying to open up two different files with the same file name, fin. Name the other something else, like
ifstream fin("map.txt");
ifstream fin2("map2.txt");

That should do it.

----------------------------------------

I'm fat, you're ugly. I can lose weight.

------------------------------------

"We are the music makers, and the dreamers of the dreams."
- Willy Wonka

This topic is closed to new replies.

Advertisement