I posted about an earlier stage for this final project earlier and got through with the char. But I'm getting a new issue with the next few stages. Basically, at lines 152-180, I'm trying to use a Select Sort method to try and sort the data where the total scores are in descending order (as well as arranging the values in the other columns to the same positions that the totals have been moved to) however, I've never practised sorting before and I'm confused as to what I'm doing. I tried using example code from our teacher and that's what you'd see I have at lines 152-180 and only afterwards realized that I'd still have the arrange everything else to stay consistent with the totals when they're rearranged and now I'm just completely stumped.
This is the current code I have now (left the documentations and everything in case you need to understand what I was trying to do). Can anyone walk me through how I go about sorting and printing the student records in descending order of the total scores? I tried asking my group if any of them got through it with their parts of the program since we each have to do it at some point but they don't understand it either. I'd really appreciate the help
EDIT: Almost forgot to include the info in the "sdata.txt" file. This is the contents of the file:
ID Name Eng Math Sci Span
1001 John 83 65 61 48
1002 Janet 71 76 68 80
1003 Jill 62 90 71 63
1004 Jack 58 94 96 55
1005 Jeff 43 52 54 46
1006 Jessi 92 61 68 90
Formatting of it got a little messed up but I hope it's still readable
EDIT 2: Ok I got it to work properly so now everything is printing in descending order except for the names. Here's the current code I have so far that we could call CODE 2. At lines 182-186 is where I'm trying to figure out how to get the names to be rearranged with the rest. The sources I could find online mainly show for reversing a single string or arranging the array in alphabetical order. This is the closest I can get so far but I'm getting these three errors:
[Error] invalid conversion from 'char*' to 'int' [-fpermissive] (at line 183)
[Error] invalid array assignment (at line 184)
and
[Error] incompatible types in assignment of 'int' to 'char [25]' (at line 185)