I am having trouble allocating a new array , this is my old function it worked perfectly but now I need to change it to a const function for my HW assignment. I am not asking for you to do the assignment for me, i have the rest of the program completed just struggling with this function
Actually you are trying to update the passed list (by swapping), and for const you can not do so.
If you require to modify the list then remove const or create a temporary copy of list in function for swapping and display in itself.
First: copy the content of student to New_StudentType which will be the sorted list.
Then: within the loope on line 11 of your New code everything is done for New_StudentType and notstudent.