Hi, I'm supposed to readin names and 3 test grades for each and find the average, now I got the entire code done but I still can't figure out how to readin the names and grades into my program. Please help! The data in the file are in this format "John Smith\n86 77 92"
@benbalach, This is exactly what I had but it does work, it only works for the first student then it gets messed up for the rest of the file, thanks anyways.
@Esegerich No, but when I know it's working because when I only do one student, everything goes well but anything above that ruins the program. Now my issue is the order of the data in the file, they go like this "John Smith\n72 98 90\nFirst Last\n80 70 60 etc." so I need a way to readin the data from the file properly so they get assigned where they should..
To remove all potential bugs from your code and to make it simpler I recommend:
* Switching the plain C style arrays to std::array, because plain old C style arrays don't know their own size and they turn into a pointer to their first element at the slightest provocation.
* Change all for loops that traverse the arrays to range based for loops
* Overloading the IO stream operators for both classes.
This will make the code much easier to understand and you might just solve the problem indirectly by making these changes.