reading in multiple files
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?
August 04, 2000 05:40 PM
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.
fin.close();
And then do:
fin.open("file2.txt");
I think this should do it.
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
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement