+ 1
A lot is wrong with it when I checked just now. It doesn't even compile. Your selection function prototype should be: void selection(struct Student* student); instead of: void selection(struct Student* student[3]); Your function call in main should be: selection(student); instead of: selection(struct Student* student[3]); In selection, you need to initialize temp1 and temp2 before referencing their properties. A lot needs to be rewritten in selection but I don't want to give more details right now that will just confuse you. This won't help your code compile but I suggest calling your array "students" instead of "student". Plural on an array name reinforces that there are many students in it instead of just one. Also, consider using a typedef so you don't have to repeat "struct" every time you use the student data type. You should fix those problems and get your code to compile before focusing on why the selection function isn't working. If I list too many changes, most of them will go over your head or you'll get stuck implementing a couple and the rest will get forgotten.
21st Oct 2020, 9:08 AM
Josh Greig
Josh Greig - avatar