File names from Input File

I have an input file (input.txt) with several file names (*.dat) listed on each line. I need to get C++ to read from the input file (which I can open) and open each data (*.dat) file. Here is what I have (it doesn't work):

1
2
3
4
5
	while (!inFile.eof())
	{
		getline (inFile, name);

		datFile.open(name, fstream::out);


Thinking it's something with "getline"...Any help will be appreciated!

Thanks.
I'm also using getline() to read from the data files, so I bet it won't work there, either.
Topic archived. No new replies allowed.