Program not writing to file at all

This program has been bugging me a lot to get working, so far I've had to fight through tons of errors Hydra style (every one I got rid of, 2 took its place). Then I finally got an error free compile, but the txt file where the answers should be was sadly empty. After more messing around, I got this crazy new error that doesn't show up on compile, rather it shows up while the program is running.

This program is designed to take a bunch of students and grades from the file "data.txt", manipulate the scores to get a final grade, and display the test average, homework average, and final grade, as well as a tally of how many of each grade the class got, in the file "out.txt".

Closing that out and hovering my mouse over some of the variables around there, I get this.

entry = 1
index = 232 (I'm guessing this is the problem, but I have no clue why it's happening)

Checking some of the variables I'm supposedly getting from the file, the first two variables (idno and test[0]) are "" and 0 respectivly. But the rest of them have this weird value of "0x009d3008". The text files that I'm using are in the right folder, so that isn't a problem.

I have no clue what to do to solve these problems I'm having, I'm pretty confident that if I can just get it to read and write correctly, it should give the right answers, but getting to that point has been heck so far, and I need to have this done by midnight tomorrow.

So if any kind soul is able to help me in any way, I would appreciate it very much.

EDIT: Minor breakthrough here, the error no longer comes up after I changed "indata" to "infile" in line 65. Now the program displays 8 rows of ??? and finishes running. But still nothing has gone to the text file.

Thanks for the help, now I'm finally done getting any sort of errors, and I'm actually getting something in my output file!

Unfortunatly it's not exactly the right answer, all it prints are the headings and the counts of each grade, no actual student data is going into the file. But there's something in there, that's step one.

I also made several changes myself, I moved all the function calls in other functions to main, and inserted for loops in the other 2 functions starting index at 0 and counting up until it hits the amount read.

I'll continue to play around with it, and check back here if I just can't get it.