So, the problem I'm having is that my functions either aren't opening the file to drag out the numbers or just isn't pulling the numbers at all. I adjusted a shortened version to see if it was a problem with arrays or functions and even in the simplified form it isn't working. I need some help.
To confirm that the infile is just not opening successfully:
1 2 3 4 5
infile.open("HeartAttackScores.dat");
if (!infile)
{
cout << "Error: Could not open file\n";
}
How are you executing your program? The working directory of your program needs to be the same directory as where the file is.
Where is your Test.txt being written to when the program runs?
PS: (1) You don't need to explicitly call <file stream>.close(), it will be done for you when the files are destructed. (2) There's no point in making your outfile/infile variables be static since they're in main anyway.
Don't worry, it's a mistake a lot of people make, especially when using an additional layer like that of an IDE which makes it harder to tell where the program is executing from.