I would love to do that but I can't use more than one function to sort is there anything I can do within the Switch case to make it less copy and paste or no?
Put the switch within the predicate that does the comparison. if (parr[count].student1 > parr[count + 1].student1)
becomes something like if ( greatherThan( parr[count], parr[count + 1], entry ) )
with you writing a predicate function bool greaterThan( Documents doc1, Documents doc2, int entry );