Need help with input streams from multiple source files
I have a master file listing 15 subfiles in the same directory. Each of these files has a name in the top line, and 2 digit numbers in each subsequent line (about 5 lines). What I need to do is open each of those file names by calling it from the master file, and print the name (first line) to the screen in descending order, and calculate the average of the numbers.
What I'm having trouble with is i get what looks like an infinite loop. I'm able to output the name and average of each file just fine, but after that, nothing happens, it seems to be trying to get input that isnt there. Im using Gnu on a unix system
Any help would be appreciated, thanks!
infile1.getline(string, 80, '\n');
infile2.getline(name, 80, '\n'); //get name
/*-----------------while(!infile2.eof()) //get score
} ------------------------Gets stuck in this loop*/